Panel Interface Board  1
inszt_USB.c
Go to the documentation of this file.
1 /*
2 C TESTBED VERSION : 9.7.2
3 FILE UNDER TEST : "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\USB.c"
4 DATE OF ANALYSIS : Thu Aug 27 13:28:13 2020
5 */
6 /**************************************************************************************/
24 /**************************************************************************************/
25 /**************************************************************************************/
26 /**************************************************************************************/
27 /* Section: Included Files */
28 /**************************************************************************************/
29 /**************************************************************************************/
30 #define QQQdialect MPLABX
31 #undef QQQ146
32 #undef QQQ148
33 #undef QQQbndchk
34 #undef QQQ294
35 #undef QQQEMBEDDEDICE
36  /* Note: for BITMAP execution histories QQQthreaded is not defined */
37 #undef QQQthreaded
38 #undef QQQdo178b
39 #undef QQQfixbra
40 #define QQQswitch3
41 #undef QQQternary
42 #define QQQswitch
43 #undef QQQmacrof
44 #undef QQQMULTIPROCESSEXH
45 #undef QQFLUSH
46 #undef QQNEWBS
47 #define qqqMaxBranchDepth 20
48 #define QQQstructbitmap
49  static int qqqqbmselwidth = 32 ;
50  static int zzfileid = 62;
51 #define QQQnumfil 23
52 #undef QQQALGONE
53 #undef QQQVCLFLG
54 #undef QQQFORKFL
55 #undef QQQIADDRF
56 #undef QQQRTI
57 #undef QQQPERFA
58 #undef QQQADRMOD
59 #undef QQQDCAPFL
60 #undef QQQTEMPLATEONLY
61 #define QQQNOATEXIT
62 #define QQQUPLOADATEND
63 #define QQQNOSTDIO
64 #undef QQQASHLINGVITRA
65 #define QQQBITMAP
66  #define qqqbitmapint unsigned int
67 #undef QQQBITMAPMCDC
68 #undef QQQTIC2XSERIALIO
69 #undef QQQTIC2XFLASH
70 #undef QQQCOMPRESSED_EXH
71 #undef QQQMAINFL
72 #define QQQSINGLEFILE
73 #define QQQFILEID
74 #define QQQseparate
75 extern int QQQindicator;
76 static int QQQfirstmcdc=1;
77 #define USB_62zzopen zzopen
78  extern int USB_62zzopen ;
79 #define USB_62zqqzqz1 zqqzqz1
80 #define QQQLDRA_PORT
81 #ifndef QQQLDRA_PORT
82 #define FILEPOINT FILE * f,
83 #if !defined(QQQTEMPLATEONLY) && !defined(FILE) && !defined(QQQNOSTDIO)
84 #include <stdio.h>
85  /* ----------------------------------------------------------------------* 100 *
86  * If stdio.h is not available then insert:
87  * typedef int * FILE;
88  * -----------------------------------------------------------------------------
89  */
90 #endif /* !(QQQTEMPLATEONLY) && !(FILE) && !(QQQNOSTDIO) */
91 #else /* QQQLDRA_PORT */
92 #define FILEPOINT
93 /*************************** LDRA_PORT *********************************/
94 #ifdef QQQ_SHLAYOUT
95 static int tbrun_mode=1;
96 #else
97 static int tbrun_mode=0;
98 #endif /* QQQ_SHLAYOUT */
99 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.h"
100 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.h"
101 #ifndef QQQ_SHLAYOUT
102 #ifdef QQQMAINFL
103 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.c"
104 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.c"
105 #endif /* QQQMAINFL */
106 #endif /* QQQ_SHLAYOUT */
107 /************************ END OF LDRA_PORT *****************************/
108 #endif /* QQQLDRA_PORT */
109 #ifndef QQQnumfil
110 #define QQQnumfil 40 /* default setting */
111 #endif /* QQQnumfil */
112 #if defined(QQQstructbitmap) && defined(QQQSINGLEFILE)
113 #ifndef LDRA_VOID_FUNC
114 #define LDRA_VOID_FUNC
115  typedef void(*ldra_void_function)();
116 #endif
117 #if defined(QQQMAINFL)
118  /* Set qqqshell_upload to 1 if you want to call the qqqtotalupload separately. Although
119  through the target you would have to set this to 0 before calling the qqqupload.
120  Move this into ldra_port mechanism. */
121  int qqqshell_upload = 0;
122  int QQQfcn_ptr_num = 0;
123  static int qqqisinitialised = 0;
126  void qqqtotalupload(void);
127  void qqqtotalreset(void);
129  qqqaccumupload[x]=y;
130  qqqaccumreset[x]=z;
131  QQQfcn_ptr_num++;
132  }
133 #else /* (QQQMAINFL) */
134  extern int QQQfcn_ptr_num;
137  static int qqqstructzzopen = 0;
138 #endif /* defined(QQQMAINFL) */
139 #endif /* defined(QQQstructbitmap) && defined(QQQSINGLEFILE) */
140 #ifdef QQQ_KEEPCOMMENTS
141  /* -----------------------------------------------------------------------* 101 *
142  * Special settings for systems lacking standard functions.
143  * To include code for fprintf define ldra_fprintf
144  * To include code for sscanf define ldra_sscanf
145  * -----------------------------------------------------------------------------
146  */
147 #endif /* QQQ_KEEPCOMMENTS */
148 #if !defined(QQQSUPPRESS_UNDEF)
149 #undef ldra_fprintf
150 #undef ldra_sscanf
151 #endif /* !defined(QQQSUPPRESS_UNDEF) */
152  /* #define ldra_fprintf */
153  /* #define ldra_sscanf */
154 #undef QQQHITMAP_STORAGE
155 #undef qqnull_params
156 #define qqnull_params void
157 #define QQQ_PROTOTYPE_DEF
158  /* Conventional Instrumentation */
159 #undef QQ_ANSI_PROTOTYPE
160 #ifdef __STDC__
161 #define QQ_ANSI_PROTOTYPE 1
162 #else /* __STDC__ */
163 #ifdef VAXC
164 #define QQ_ANSI_PROTOTYPE 1
165 #endif /* VAXC */
166 #endif /* __STDC__ */
167  static unsigned char qqqzzglobflag = 0;
168  static struct bitmapstruct_t
169  {
170 #define ELEMENT(N) qqqbitmapint element##N;
171 #define LASTELEMENT
172 #include "USB_62zbelem.def"
173 #undef ELEMENT
174 #undef LASTELEMENT
175  } bitmapstruct = {
176 #define ELEMENT(N) 0,
177 #undef LASTELEMENT
178 #include "USB_62zbelem.def"
179 #undef ELEMENT
180  0};
181  static void qqoutput(FILEPOINT char * s,int i);
182  static void qqoutput2(FILEPOINT char * s,int i, int j);
183  static void qqoutput3(FILEPOINT char * s,int i,int j,int k);
184  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l);
185  static void qqoutput0(FILEPOINT char * s);
186  static int USB_62zqqzqz(qqnull_params);
187  static int USB_62zqqzqz1(qqnull_params);
188  static int USB_62zqendz (int qqqi);
189  static int USB_62zqzqzq (int qqqi);
190  static void qqqupload(qqnull_params);
191  static void qqqbitmapreset(qqnull_params);
192 /* ------------------------------ END OF TESTBED PROTOTYPES -------------------------------- */
193 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\USB.h */
194 /**************************************************************************************/
209 /**************************************************************************************/
210 #ifndef USB_H /* Guard against multiple inclusion */
211 #define USB_H
212 /**************************************************************************************/
213 /**************************************************************************************/
214 /* Section: Included Files */
215 /**************************************************************************************/
216 /**************************************************************************************/
217 #include <stdint.h>
218 #include <stdbool.h>
219 #include <stddef.h>
220 #include <stdlib.h>
221 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h */
222 /*******************************************************************************
223  MPLAB Harmony System Configuration Header
224  File Name:
225  system_config.h
226  Summary:
227  Build-time configuration header for the system defined by this MPLAB Harmony
228  project.
229  Description:
230  An MPLAB Project may have multiple configurations. This file defines the
231  build-time options for a single configuration.
232  Remarks:
233  This configuration header must not define any prototypes or data
234  definitions (or include any files that do). It only provides macro
235  definitions for build-time configuration options that are not instantiated
236  until used by another MPLAB Harmony module or application.
237  Created with MPLAB Harmony Version 2.06
238 *******************************************************************************/
239 // DOM-IGNORE-BEGIN
240 /*******************************************************************************
241 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
242 Microchip licenses to you the right to use, modify, copy and distribute
243 Software only when embedded on a Microchip microcontroller or digital signal
244 controller that is integrated into your product or third party product
245 (pursuant to the sublicense terms in the accompanying license agreement).
246 You should refer to the license agreement accompanying this Software for
247 additional information regarding your rights and obligations.
248 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
249 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
250 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
251 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
252 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
253 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
254 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
255 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
256 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
257 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
258 *******************************************************************************/
259 // DOM-IGNORE-END
260 #ifndef _SYSTEM_CONFIG_H
261 #define _SYSTEM_CONFIG_H
262 // *****************************************************************************
263 // *****************************************************************************
264 // Section: Included Files
265 // *****************************************************************************
266 // *****************************************************************************
267 /* This section Includes other configuration headers necessary to completely
268  define this configuration.
269 */
270 // DOM-IGNORE-BEGIN
271 // DOM-IGNORE-END
272 // *****************************************************************************
273 // *****************************************************************************
274 // Section: System Service Configuration
275 // *****************************************************************************
276 // *****************************************************************************
277 // *****************************************************************************
278 /* Common System Service Configuration Options
279 */
280 #define SYS_VERSION_STR "2.06"
281 #define SYS_VERSION 20600
282 // *****************************************************************************
283 /* Clock System Service Configuration Options
284 */
285 #define SYS_CLK_FREQ 200000000ul
286 #define SYS_CLK_BUS_PERIPHERAL_1 100000000ul
287 #define SYS_CLK_BUS_PERIPHERAL_2 100000000ul
288 #define SYS_CLK_BUS_PERIPHERAL_3 100000000ul
289 #define SYS_CLK_BUS_PERIPHERAL_4 100000000ul
290 #define SYS_CLK_BUS_PERIPHERAL_5 100000000ul
291 #define SYS_CLK_BUS_PERIPHERAL_7 200000000ul
292 #define SYS_CLK_BUS_PERIPHERAL_8 100000000ul
293 #define SYS_CLK_CONFIG_PRIMARY_XTAL 0ul
294 #define SYS_CLK_CONFIG_SECONDARY_XTAL 32768ul
295 /*** Ports System Service Configuration ***/
296 #define SYS_PORT_A_ANSEL 0x3F00
297 #define SYS_PORT_A_TRIS 0xFFED
298 #define SYS_PORT_A_LAT 0x0010
299 #define SYS_PORT_A_ODC 0x0000
300 #define SYS_PORT_A_CNPU 0x0020
301 #define SYS_PORT_A_CNPD 0x0000
302 #define SYS_PORT_A_CNEN 0x0021
303 #define SYS_PORT_B_ANSEL 0x10C8
304 #define SYS_PORT_B_TRIS 0x91FF
305 #define SYS_PORT_B_LAT 0x0000
306 #define SYS_PORT_B_ODC 0x0000
307 #define SYS_PORT_B_CNPU 0x0000
308 #define SYS_PORT_B_CNPD 0x0000
309 #define SYS_PORT_B_CNEN 0x0000
310 #define SYS_PORT_C_ANSEL 0xCFE1
311 #define SYS_PORT_C_TRIS 0xFFFF
312 #define SYS_PORT_C_LAT 0x0000
313 #define SYS_PORT_C_ODC 0x0000
314 #define SYS_PORT_C_CNPU 0x0000
315 #define SYS_PORT_C_CNPD 0x0000
316 #define SYS_PORT_C_CNEN 0x0000
317 #define SYS_PORT_D_ANSEL 0xC100
318 #define SYS_PORT_D_TRIS 0xFFFF
319 #define SYS_PORT_D_LAT 0x0000
320 #define SYS_PORT_D_ODC 0x0000
321 #define SYS_PORT_D_CNPU 0x0000
322 #define SYS_PORT_D_CNPD 0x0000
323 #define SYS_PORT_D_CNEN 0x0000
324 #define SYS_PORT_E_ANSEL 0xFC00
325 #define SYS_PORT_E_TRIS 0xFDFF
326 #define SYS_PORT_E_LAT 0x0000
327 #define SYS_PORT_E_ODC 0x0000
328 #define SYS_PORT_E_CNPU 0x0000
329 #define SYS_PORT_E_CNPD 0x0000
330 #define SYS_PORT_E_CNEN 0x0000
331 #define SYS_PORT_F_ANSEL 0xCEC0
332 #define SYS_PORT_F_TRIS 0xEFFF
333 #define SYS_PORT_F_LAT 0x0000
334 #define SYS_PORT_F_ODC 0x0000
335 #define SYS_PORT_F_CNPU 0x0000
336 #define SYS_PORT_F_CNPD 0x0000
337 #define SYS_PORT_F_CNEN 0x0000
338 #define SYS_PORT_G_ANSEL 0x8CBC
339 #define SYS_PORT_G_TRIS 0xDFFF
340 #define SYS_PORT_G_LAT 0x0000
341 #define SYS_PORT_G_ODC 0x0000
342 #define SYS_PORT_G_CNPU 0x0000
343 #define SYS_PORT_G_CNPD 0x0000
344 #define SYS_PORT_G_CNEN 0x0000
345 #define SYS_PORT_H_ANSEL 0x0070
346 #define SYS_PORT_H_TRIS 0xB3FB
347 #define SYS_PORT_H_LAT 0x0000
348 #define SYS_PORT_H_ODC 0x0000
349 #define SYS_PORT_H_CNPU 0x0000
350 #define SYS_PORT_H_CNPD 0x0000
351 #define SYS_PORT_H_CNEN 0x0000
352 #define SYS_PORT_J_ANSEL 0x0000
353 #define SYS_PORT_J_TRIS 0x8B7F
354 #define SYS_PORT_J_LAT 0x0080
355 #define SYS_PORT_J_ODC 0x0000
356 #define SYS_PORT_J_CNPU 0x0000
357 #define SYS_PORT_J_CNPD 0x0000
358 #define SYS_PORT_J_CNEN 0x0800
359 #define SYS_PORT_K_ANSEL 0xFF00
360 #define SYS_PORT_K_TRIS 0xFFFF
361 #define SYS_PORT_K_LAT 0x0000
362 #define SYS_PORT_K_ODC 0x0000
363 #define SYS_PORT_K_CNPU 0x0000
364 #define SYS_PORT_K_CNPD 0x0000
365 #define SYS_PORT_K_CNEN 0x0000
366 /*** Interrupt System Service Configuration ***/
367 #define SYS_INT true
368 /*** Timer System Service Configuration ***/
369 #define SYS_TMR_POWER_STATE SYS_MODULE_POWER_RUN_FULL
370 #define SYS_TMR_DRIVER_INDEX DRV_TMR_INDEX_0
371 #define SYS_TMR_MAX_CLIENT_OBJECTS 5
372 #define SYS_TMR_FREQUENCY 1000
373 #define SYS_TMR_FREQUENCY_TOLERANCE 10
374 #define SYS_TMR_UNIT_RESOLUTION 10000
375 #define SYS_TMR_CLIENT_TOLERANCE 10
376 #define SYS_TMR_INTERRUPT_NOTIFICATION false
377 // *****************************************************************************
378 // *****************************************************************************
379 // Section: Driver Configuration
380 // *****************************************************************************
381 // *****************************************************************************
382 #define DRV_IC_DRIVER_MODE_STATIC
383 #define USE_8BIT_PMP
384 /*** SPI Driver Configuration ***/
385 #define DRV_SPI_NUMBER_OF_MODULES 6
386 /*** Driver Compilation and static configuration options. ***/
387 /*** Select SPI compilation units.***/
388 #define DRV_SPI_POLLED 1
389 #define DRV_SPI_ISR 0
390 #define DRV_SPI_MASTER 1
391 #define DRV_SPI_SLAVE 0
392 #define DRV_SPI_RM 0
393 #define DRV_SPI_EBM 1
394 #define DRV_SPI_8BIT 1
395 #define DRV_SPI_16BIT 1
396 #define DRV_SPI_32BIT 0
397 #define DRV_SPI_DMA 0
398 /*** SPI Driver Static Allocation Options ***/
399 #define DRV_SPI_INSTANCES_NUMBER 3
400 #define DRV_SPI_CLIENTS_NUMBER 3
401 #define DRV_SPI_ELEMENTS_PER_QUEUE 10
402 /* SPI Driver Instance 0 Configuration */
403 #define DRV_SPI_SPI_ID_IDX0 SPI_ID_1
404 #define DRV_SPI_TASK_MODE_IDX0 DRV_SPI_TASK_MODE_POLLED
405 #define DRV_SPI_SPI_MODE_IDX0 DRV_SPI_MODE_MASTER
406 #define DRV_SPI_ALLOW_IDLE_RUN_IDX0 false
407 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX0 DRV_SPI_PROTOCOL_TYPE_FRAMED
408 #define DRV_SPI_FRAME_SYNC_PULSE_IDX0 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
409 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX0 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
410 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX0 SPI_FRAME_PULSE_DIRECTION_OUTPUT
411 #define DRV_SPI_FRAME_PULSE_EDGE_IDX0 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
412 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX0 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
413 #define DRV_SPI_COMM_WIDTH_IDX0 SPI_COMMUNICATION_WIDTH_16BITS
414 #define DRV_SPI_CLOCK_SOURCE_IDX0 SPI_BAUD_RATE_PBCLK_CLOCK
415 #define DRV_SPI_SPI_CLOCK_IDX0 CLK_BUS_PERIPHERAL_2
416 #define DRV_SPI_BAUD_RATE_IDX0 1000000
417 #define DRV_SPI_BUFFER_TYPE_IDX0 DRV_SPI_BUFFER_TYPE_ENHANCED
418 #define DRV_SPI_CLOCK_MODE_IDX0 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
419 #define DRV_SPI_INPUT_PHASE_IDX0 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
420 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX0 0xFFFF
421 #define DRV_SPI_QUEUE_SIZE_IDX0 10
422 #define DRV_SPI_RESERVED_JOB_IDX0 1
423 /* SPI Driver Instance 1 Configuration */
424 #define DRV_SPI_SPI_ID_IDX1 SPI_ID_2
425 #define DRV_SPI_TASK_MODE_IDX1 DRV_SPI_TASK_MODE_POLLED
426 #define DRV_SPI_SPI_MODE_IDX1 DRV_SPI_MODE_MASTER
427 #define DRV_SPI_ALLOW_IDLE_RUN_IDX1 false
428 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX1 DRV_SPI_PROTOCOL_TYPE_FRAMED
429 #define DRV_SPI_FRAME_SYNC_PULSE_IDX1 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
430 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX1 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
431 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX1 SPI_FRAME_PULSE_DIRECTION_OUTPUT
432 #define DRV_SPI_FRAME_PULSE_EDGE_IDX1 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
433 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX1 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
434 #define DRV_SPI_COMM_WIDTH_IDX1 SPI_COMMUNICATION_WIDTH_8BITS
435 #define DRV_SPI_CLOCK_SOURCE_IDX1 SPI_BAUD_RATE_PBCLK_CLOCK
436 #define DRV_SPI_SPI_CLOCK_IDX1 CLK_BUS_PERIPHERAL_2
437 #define DRV_SPI_BAUD_RATE_IDX1 1000000
438 #define DRV_SPI_BUFFER_TYPE_IDX1 DRV_SPI_BUFFER_TYPE_ENHANCED
439 #define DRV_SPI_CLOCK_MODE_IDX1 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
440 #define DRV_SPI_INPUT_PHASE_IDX1 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
441 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX1 0xFF
442 #define DRV_SPI_QUEUE_SIZE_IDX1 10
443 #define DRV_SPI_RESERVED_JOB_IDX1 1
444 /* SPI Driver Instance 2 Configuration */
445 #define DRV_SPI_SPI_ID_IDX2 SPI_ID_4
446 #define DRV_SPI_TASK_MODE_IDX2 DRV_SPI_TASK_MODE_POLLED
447 #define DRV_SPI_SPI_MODE_IDX2 DRV_SPI_MODE_MASTER
448 #define DRV_SPI_ALLOW_IDLE_RUN_IDX2 false
449 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX2 DRV_SPI_PROTOCOL_TYPE_FRAMED
450 #define DRV_SPI_FRAME_SYNC_PULSE_IDX2 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
451 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX2 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
452 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX2 SPI_FRAME_PULSE_DIRECTION_OUTPUT
453 #define DRV_SPI_FRAME_PULSE_EDGE_IDX2 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
454 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX2 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
455 #define DRV_SPI_COMM_WIDTH_IDX2 SPI_COMMUNICATION_WIDTH_16BITS
456 #define DRV_SPI_CLOCK_SOURCE_IDX2 SPI_BAUD_RATE_PBCLK_CLOCK
457 #define DRV_SPI_SPI_CLOCK_IDX2 CLK_BUS_PERIPHERAL_2
458 #define DRV_SPI_BAUD_RATE_IDX2 500000
459 #define DRV_SPI_BUFFER_TYPE_IDX2 DRV_SPI_BUFFER_TYPE_ENHANCED
460 #define DRV_SPI_CLOCK_MODE_IDX2 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
461 #define DRV_SPI_INPUT_PHASE_IDX2 SPI_INPUT_SAMPLING_PHASE_AT_END
462 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX2 0x0000
463 #define DRV_SPI_QUEUE_SIZE_IDX2 10
464 #define DRV_SPI_RESERVED_JOB_IDX2 1
465 /*** Timer Driver Configuration ***/
466 #define DRV_TMR_INTERRUPT_MODE true
467 /*** Timer Driver 0 Configuration ***/
468 #define DRV_TMR_PERIPHERAL_ID_IDX0 TMR_ID_2
469 #define DRV_TMR_INTERRUPT_SOURCE_IDX0 INT_SOURCE_TIMER_2
470 #define DRV_TMR_INTERRUPT_VECTOR_IDX0 INT_VECTOR_T2
471 #define DRV_TMR_ISR_VECTOR_IDX0 _TIMER_2_VECTOR
472 #define DRV_TMR_INTERRUPT_PRIORITY_IDX0 INT_PRIORITY_LEVEL4
473 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX0 INT_SUBPRIORITY_LEVEL0
474 #define DRV_TMR_CLOCK_SOURCE_IDX0 DRV_TMR_CLKSOURCE_INTERNAL
475 #define DRV_TMR_PRESCALE_IDX0 TMR_PRESCALE_VALUE_8
476 #define DRV_TMR_OPERATION_MODE_IDX0 DRV_TMR_OPERATION_MODE_16_BIT
477 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX0 false
478 #define DRV_TMR_POWER_STATE_IDX0
479 #define DRV_TMR_PERIPHERAL_ID_IDX1 TMR_ID_7
480 #define DRV_TMR_INTERRUPT_SOURCE_IDX1 INT_SOURCE_TIMER_7
481 #define DRV_TMR_INTERRUPT_VECTOR_IDX1 INT_VECTOR_T7
482 #define DRV_TMR_ISR_VECTOR_IDX1 _TIMER_7_VECTOR
483 #define DRV_TMR_INTERRUPT_PRIORITY_IDX1 INT_PRIORITY_LEVEL3
484 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX1 INT_SUBPRIORITY_LEVEL0
485 #define DRV_TMR_CLOCK_SOURCE_IDX1 DRV_TMR_CLKSOURCE_INTERNAL
486 #define DRV_TMR_PRESCALE_IDX1 TMR_PRESCALE_VALUE_16
487 #define DRV_TMR_OPERATION_MODE_IDX1 DRV_TMR_OPERATION_MODE_16_BIT
488 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX1 false
489 #define DRV_TMR_POWER_STATE_IDX1
490 /*** Timer Driver 2 Configuration ***/
491 #define DRV_TMR_PERIPHERAL_ID_IDX2 TMR_ID_6
492 #define DRV_TMR_INTERRUPT_SOURCE_IDX2 INT_SOURCE_TIMER_6
493 #define DRV_TMR_INTERRUPT_VECTOR_IDX2 INT_VECTOR_T6
494 #define DRV_TMR_ISR_VECTOR_IDX2 _TIMER_6_VECTOR
495 #define DRV_TMR_INTERRUPT_PRIORITY_IDX2 INT_PRIORITY_LEVEL1
496 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX2 INT_SUBPRIORITY_LEVEL0
497 #define DRV_TMR_CLOCK_SOURCE_IDX2 DRV_TMR_CLKSOURCE_INTERNAL
498 #define DRV_TMR_PRESCALE_IDX2 TMR_PRESCALE_VALUE_16
499 #define DRV_TMR_OPERATION_MODE_IDX2 DRV_TMR_OPERATION_MODE_16_BIT
500 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX2 false
501 #define DRV_TMR_POWER_STATE_IDX2
502 /*** Timer Driver 3 Configuration ***/
503 #define DRV_TMR_PERIPHERAL_ID_IDX3 TMR_ID_1
504 #define DRV_TMR_INTERRUPT_SOURCE_IDX3 INT_SOURCE_TIMER_1
505 #define DRV_TMR_INTERRUPT_VECTOR_IDX3 INT_VECTOR_T1
506 #define DRV_TMR_ISR_VECTOR_IDX3 _TIMER_1_VECTOR
507 #define DRV_TMR_INTERRUPT_PRIORITY_IDX3 INT_PRIORITY_LEVEL2
508 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX3 INT_SUBPRIORITY_LEVEL0
509 #define DRV_TMR_CLOCK_SOURCE_IDX3 DRV_TMR_CLKSOURCE_INTERNAL
510 #define DRV_TMR_PRESCALE_IDX3 TMR_PRESCALE_VALUE_256
511 #define DRV_TMR_OPERATION_MODE_IDX3 DRV_TMR_OPERATION_MODE_16_BIT
512 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX3 false
513 #define DRV_TMR_POWER_STATE_IDX3
514 /*** Timer Driver 4 Configuration ***/
515 #define DRV_TMR_PERIPHERAL_ID_IDX4 TMR_ID_3
516 #define DRV_TMR_INTERRUPT_SOURCE_IDX4 INT_SOURCE_TIMER_3
517 #define DRV_TMR_INTERRUPT_VECTOR_IDX4 INT_VECTOR_T3
518 #define DRV_TMR_ISR_VECTOR_IDX4 _TIMER_3_VECTOR
519 #define DRV_TMR_INTERRUPT_PRIORITY_IDX4 INT_PRIORITY_LEVEL1
520 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX4 INT_SUBPRIORITY_LEVEL0
521 #define DRV_TMR_CLOCK_SOURCE_IDX4 DRV_TMR_CLKSOURCE_INTERNAL
522 #define DRV_TMR_PRESCALE_IDX4 TMR_PRESCALE_VALUE_16
523 #define DRV_TMR_OPERATION_MODE_IDX4 DRV_TMR_OPERATION_MODE_16_BIT
524 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX4 false
525 #define DRV_TMR_POWER_STATE_IDX4
526  // *****************************************************************************
527 /* USART Driver Configuration Options
528 */
529 #define DRV_USART_INSTANCES_NUMBER 1
530 #define DRV_USART_CLIENTS_NUMBER 1
531 #define DRV_USART_INTERRUPT_MODE false
532 #define DRV_USART_BYTE_MODEL_SUPPORT true
533 #define DRV_USART_READ_WRITE_MODEL_SUPPORT false
534 #define DRV_USART_BUFFER_QUEUE_SUPPORT false
535 // *****************************************************************************
536 // *****************************************************************************
537 // Section: Middleware & Other Library Configuration
538 // *****************************************************************************
539 // *****************************************************************************
540 /*** USB Driver Configuration ***/
541 /* Enables Device Support */
542 #define DRV_USBHS_DEVICE_SUPPORT true
543 /* Disable Host Support */
544 #define DRV_USBHS_HOST_SUPPORT false
545 /* Maximum USB driver instances */
546 #define DRV_USBHS_INSTANCES_NUMBER 1
547 /* Interrupt mode enabled */
548 #define DRV_USBHS_INTERRUPT_MODE true
549 /* Number of Endpoints used */
550 #define DRV_USBHS_ENDPOINTS_NUMBER 2
551 /*** USB Device Stack Configuration ***/
552 /* The USB Device Layer will not initialize the USB Driver */
553 #define USB_DEVICE_DRIVER_INITIALIZE_EXPLICIT
554 /* Maximum device layer instances */
555 #define USB_DEVICE_INSTANCES_NUMBER 1
556 /* EP0 size in bytes */
557 #define USB_DEVICE_EP0_BUFFER_SIZE 64
558 /* Endpoint Transfer Queue Size combined for Read and write */
559 #define USB_DEVICE_ENDPOINT_QUEUE_DEPTH_COMBINED 2
560 // *****************************************************************************
561 // *****************************************************************************
562 // Section: Application Configuration
563 // *****************************************************************************
564 // *****************************************************************************
565 /*** Application Defined Pins ***/
566 /*** Functions for LED1 pin ***/
567 #define LED1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
568 #define LED1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
569 #define LED1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
570 #define LED1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
571 #define LED1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 , Value )
572 /*** Functions for LED2 pin ***/
573 #define LED2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
574 #define LED2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
575 #define LED2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
576 #define LED2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
577 #define LED2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 , Value )
578 /*** Functions for DMP_FIRE_LED pin ***/
579 #define DMP_FIRE_LEDToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
580 #define DMP_FIRE_LEDOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
581 #define DMP_FIRE_LEDOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
582 #define DMP_FIRE_LEDStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
583 #define DMP_FIRE_LEDStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 , Value )
584 /*** Functions for HVPS_ENB pin ***/
585 #define HVPS_ENBToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
586 #define HVPS_ENBOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
587 #define HVPS_ENBOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
588 #define HVPS_ENBStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
589 #define HVPS_ENBStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 , Value )
590 /*** Functions for RLY_HVPS_OUT pin ***/
591 #define RLY_HVPS_OUTToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
592 #define RLY_HVPS_OUTOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
593 #define RLY_HVPS_OUTOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
594 #define RLY_HVPS_OUTStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
595 #define RLY_HVPS_OUTStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 , Value )
596 /*** Functions for RLY_WL_SPS_POL pin ***/
597 #define RLY_WL_SPS_POLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
598 #define RLY_WL_SPS_POLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
599 #define RLY_WL_SPS_POLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
600 #define RLY_WL_SPS_POLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
601 #define RLY_WL_SPS_POLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 , Value )
602 /*** Functions for RLY_LOG pin ***/
603 #define RLY_LOGToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
604 #define RLY_LOGOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
605 #define RLY_LOGOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
606 #define RLY_LOGStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
607 #define RLY_LOGStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 , Value )
608 /*** Functions for RLY_DMP_FIRE pin ***/
609 #define RLY_DMP_FIREToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
610 #define RLY_DMP_FIREOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
611 #define RLY_DMP_FIREOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
612 #define RLY_DMP_FIREStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
613 #define RLY_DMP_FIREStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 , Value )
614 /*** Functions for RLY_AUX pin ***/
615 #define RLY_AUXToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
616 #define RLY_AUXOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
617 #define RLY_AUXOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
618 #define RLY_AUXStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
619 #define RLY_AUXStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 , Value )
620 /*** Functions for RLY_CCL pin ***/
621 #define RLY_CCLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
622 #define RLY_CCLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
623 #define RLY_CCLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
624 #define RLY_CCLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
625 #define RLY_CCLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 , Value )
626 /*** Functions for RLY_WL_MON pin ***/
627 #define RLY_WL_MONToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
628 #define RLY_WL_MONOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
629 #define RLY_WL_MONOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
630 #define RLY_WL_MONStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
631 #define RLY_WL_MONStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 , Value )
632 /*** Functions for RLY_ARMCF pin ***/
633 #define RLY_ARMCFToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
634 #define RLY_ARMCFOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
635 #define RLY_ARMCFOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
636 #define RLY_ARMCFStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
637 #define RLY_ARMCFStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 , Value )
638 /*** Functions for RLY_ARM pin ***/
639 #define RLY_ARMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
640 #define RLY_ARMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
641 #define RLY_ARMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
642 #define RLY_ARMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
643 #define RLY_ARMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 , Value )
644 /*** Functions for TPAN1 pin ***/
645 #define TPAN1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
646 #define TPAN1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
647 #define TPAN1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
648 #define TPAN1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
649 #define TPAN1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 , Value )
650 /*** Functions for TPAN2 pin ***/
651 #define TPAN2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
652 #define TPAN2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
653 #define TPAN2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
654 #define TPAN2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
655 #define TPAN2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 , Value )
656 /*** Functions for FSK_DAC_CS pin ***/
657 #define FSK_DAC_CSToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
658 #define FSK_DAC_CSOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
659 #define FSK_DAC_CSOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
660 #define FSK_DAC_CSStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
661 #define FSK_DAC_CSStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 , Value )
662 /*** Functions for RLY_COMM pin ***/
663 #define RLY_COMMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
664 #define RLY_COMMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
665 #define RLY_COMMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
666 #define RLY_COMMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
667 #define RLY_COMMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 , Value )
668 /*** Functions for FSK_DAC_CLR pin ***/
669 #define FSK_DAC_CLRToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
670 #define FSK_DAC_CLROn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
671 #define FSK_DAC_CLROff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
672 #define FSK_DAC_CLRStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
673 #define FSK_DAC_CLRStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 , Value )
674 /*** Functions for WL_CPS_SW pin ***/
675 #define WL_CPS_SWToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
676 #define WL_CPS_SWOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
677 #define WL_CPS_SWOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
678 #define WL_CPS_SWStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
679 #define WL_CPS_SWStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 , Value )
680 /*** Functions for HVPS_SW pin ***/
681 #define HVPS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_5 )
682 /*** Functions for MAN_SIG pin ***/
683 #define MAN_SIGStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_0 )
684 /*** Functions for DMP_FIRE_SW pin ***/
685 #define DMP_FIRE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_8 )
686 /*** Functions for NEG_SW pin ***/
687 #define NEG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_4 )
688 /*** Functions for POS_SW pin ***/
689 #define POS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_15 )
690 /*** Functions for DRUM1_SW pin ***/
691 #define DRUM1_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_2 )
692 /*** Functions for SAFE_SW pin ***/
693 #define SAFE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_1 )
694 /*** Functions for DRUM2_SW pin ***/
695 #define DRUM2_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_0 )
696 /*** Functions for LOG_SW pin ***/
697 #define LOG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_3 )
698 /*** Functions for AUX_SW pin ***/
699 #define AUX_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_8 )
700 /*** Functions for ARMCF_SW pin ***/
701 #define ARMCF_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_1 )
702 /*** Functions for ARM_SW pin ***/
703 #define ARM_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_2 )
704 /*** Functions for ARMCF_AUTO_SW pin ***/
705 #define ARMCF_AUTO_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_13 )
706 /*** Functions for FIRE_SW_OFF pin ***/
707 #define FIRE_SW_OFFStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_8 )
708 /*** Functions for FIRE_SW_ON pin ***/
709 #define FIRE_SW_ONStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_8 )
710 /*** Functions for WL_SPS_POS_DET pin ***/
711 #define WL_SPS_POS_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_12 )
712 /*** Functions for WL_SPS_NEG_DET pin ***/
713 #define WL_SPS_NEG_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_13 )
714 #define MAN_CN_PORT_CHANNEL PORT_CHANNEL_A
715 #define MAN_CN_PORT_BIT PORTS_BIT_POS_0
716 #define MAN_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_A
717 #define HVPS_CN_PORT_CHANNEL PORT_CHANNEL_J
718 #define HVPS_CN_PORT_BIT PORTS_BIT_POS_11
719 #define HVPS_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_J
720 /*** Application Instance 0 Configuration ***/
721 //DOM-IGNORE-BEGIN
722 //DOM-IGNORE-END
723  // _SYSTEM_CONFIG_H
724 /*******************************************************************************
725  End of File
726 */
727 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h*/
728 /* CLOSE_FILE Include File */
729 
730 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h */
731 /*******************************************************************************
732  System Definitions
733  File Name:
734  system_definitions.h
735  Summary:
736  MPLAB Harmony project system definitions.
737  Description:
738  This file contains the system-wide prototypes and definitions for an MPLAB
739  Harmony project.
740  *******************************************************************************/
741 //DOM-IGNORE-BEGIN
742 /*******************************************************************************
743 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
744 Microchip licenses to you the right to use, modify, copy and distribute
745 Software only when embedded on a Microchip microcontroller or digital signal
746 controller that is integrated into your product or third party product
747 (pursuant to the sublicense terms in the accompanying license agreement).
748 You should refer to the license agreement accompanying this Software for
749 additional information regarding your rights and obligations.
750 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
751 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
752 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
753 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
754 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
755 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
756 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
757 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
758 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
759 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
760  *******************************************************************************/
761 //DOM-IGNORE-END
762 #ifndef _SYS_DEFINITIONS_H
763 #define _SYS_DEFINITIONS_H
764 // *****************************************************************************
765 // *****************************************************************************
766 // Section: Included Files
767 // *****************************************************************************
768 // *****************************************************************************
769 #include <stdint.h>
770 #include <stddef.h>
771 #include <stdbool.h>
772 #include "system/common/sys_common.h"
773 #include "system/common/sys_module.h"
774 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h */
775 /*******************************************************************************
776  Input Capture Driver Interface Declarations for Static Single Instance Driver
777  Company:
778  Microchip Technology Inc.
779  File Name:
780  help_drv_ic.h
781  Summary:
782  Input Capture driver interface declarations for the static single instance
783  driver.
784  Description:
785  The Input Capture device driver provides a simple interface to manage the
786  Input Capture modules on Microchip microcontrollers. This file defines
787  the interface declarations for the IC driver.
788 
789  Remarks:
790  Static interfaces incorporate the driver instance number within the names
791  of the routines, eliminating the need for an object ID or object handle.
792 
793  Static single-open interfaces also eliminate the need for the open handle.
794 *******************************************************************************/
795 //DOM-IGNORE-BEGIN
796 /*******************************************************************************
797 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
798 Microchip licenses to you the right to use, modify, copy and distribute
799 Software only when embedded on a Microchip microcontroller or digital signal
800 controller that is integrated into your product or third party product
801 (pursuant to the sublicense terms in the accompanying license agreement).
802 You should refer to the license agreement accompanying this Software for
803 additional information regarding your rights and obligations.
804 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
805 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
806 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
807 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
808 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
809 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
810 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
811 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
812 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
813 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
814 *******************************************************************************/
815 //DOM-IGNORE-END
816 #ifndef _DRV_IC_H
817 #define _DRV_IC_H
818 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
819 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\driver_common.h */
820 /*******************************************************************************
821  Driver Common Header Definitions
822  Company:
823  Microchip Technology Inc.
824  File Name:
825  drv_common.h
826  Summary:
827  This file defines the common macros and definitions used by the driver
828  definition and implementation headers.
829  Description:
830  This file defines the common macros and definitions used by the driver
831  definition and the implementation header.
832  Remarks:
833  The directory in which this file resides should be added to the compiler's
834  search path for header files.
835  *******************************************************************************/
836 //DOM-IGNORE-BEGIN
837 /*******************************************************************************
838 Copyright (c) 2010-2013 released Microchip Technology Inc. All rights reserved.
839 Microchip licenses to you the right to use, modify, copy and distribute
840 Software only when embedded on a Microchip microcontroller or digital signal
841 controller that is integrated into your product or third party product
842 (pursuant to the sublicense terms in the accompanying license agreement).
843 You should refer to the license agreement accompanying this Software for
844 additional information regarding your rights and obligations.
845 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
846 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
847 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
848 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
849 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
850 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
851 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
852 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
853 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
854 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
855  *******************************************************************************/
856 //DOM-IGNORE-END
857 #ifndef _DRV_COMMON_H
858 #define _DRV_COMMON_H
859 #include <stdint.h>
860 #include <stddef.h>
861 // *****************************************************************************
862 /* Device Driver I/O Intent
863  Summary:
864  Identifies the intended usage of the device when it is opened.
865  Description:
866  This enumeration identifies the intended usage of the device when the
867  caller opens the device. It identifies the desired behavior of the device
868  driver for the following:
869  * Blocking or non-blocking I/O behavior (do I/O calls such as read and write
870  block until the operation is finished or do they return immediately and
871  require the caller to call another routine to check the status of the
872  operation)
873  * Support reading and/or writing of data from/to the device
874  * Identify the buffering behavior (sometimes called "double buffering" of
875  the driver. Indicates if the driver should maintain its own read/write
876  buffers and copy data to/from these buffers to/from the caller's buffers.
877  * Identify the DMA behavior of the peripheral
878  Remarks:
879  The buffer allocation method is not identified by this enumeration. Buffers
880  can be allocated statically at build time, dynamically at run-time, or
881  even allocated by the caller and passed to the driver for its own usage if
882  a driver-specific routine is provided for such. This choice is left to
883  the design of the individual driver and is considered part of its
884  interface.
885  These values can be considered "flags". One selection from each of the
886  groups below can be ORed together to create the complete value passed
887  to the driver's open routine.
888 */
889 
890 typedef
891  enum
892  {
893  /* Read */
894  DRV_IO_INTENT_READ /*DOM-IGNORE-BEGIN*/
895  = 1 << 0 /* DOM-IGNORE-END*/
896  ,
897  /* Write */
898  DRV_IO_INTENT_WRITE /*DOM-IGNORE-BEGIN*/
899  = 1 << 1 /* DOM-IGNORE-END*/
900  ,
901  /* Read and Write*/
902  DRV_IO_INTENT_READWRITE /*DOM-IGNORE-BEGIN*/
903  = DRV_IO_INTENT_READ | DRV_IO_INTENT_WRITE /* DOM-IGNORE-END*/
904  ,
905  /* The driver will block and will return when the operation is complete */
906  DRV_IO_INTENT_BLOCKING /*DOM-IGNORE-BEGIN*/
907  = 0 << 2 /* DOM-IGNORE-END*/
908  ,
909  /* The driver will return immediately */
910  DRV_IO_INTENT_NONBLOCKING /*DOM-IGNORE-BEGIN*/
911  = 1 << 2 /* DOM-IGNORE-END*/
912  ,
913  /* The driver will support only one client at a time */
914  DRV_IO_INTENT_EXCLUSIVE /*DOM-IGNORE-BEGIN*/
915  = 1 << 3 /* DOM-IGNORE-END*/
916  ,
917  /* The driver will support multiple clients at a time */
918  DRV_IO_INTENT_SHARED /*DOM-IGNORE-BEGIN*/
919  = 0 << 3 /* DOM-IGNORE-END*/
920  } DRV_IO_INTENT ;
921 // *****************************************************************************
922 /* Driver Client Status
923  Summary:
924  Identifies the current status/state of a client's connection to a driver.
925  Description:
926  This enumeration identifies the current status/state of a client's link to
927  a driver.
928  Remarks:
929  The enumeration used as the return type for the client-level status routines
930  defined by each device driver or system module (for example,
931  DRV_USART_ClientStatus) must be based on the values in this enumeration.
932 */
933 
934 typedef
935  enum
936  {
937  /* Indicates that a driver-specific error has occurred. */
939  /* An unspecified error has occurred.*/
941  /* The driver is closed, no operations for this client are ongoing,
942  and/or the given handle is invalid. */
944  /* The driver is currently busy and cannot start additional operations. */
946  /* The module is running and ready for additional operations */
948  /* Indicates that the module is in a driver-specific ready/run state. */
951 // *****************************************************************************
952 /* Device Driver Blocking Status Macro
953  Summary:
954  Returns if the I/O intent provided is blocking
955  Description:
956  This macro returns if the I/O intent provided is blocking.
957  Remarks:
958  None.
959 */
960 #define DRV_IO_ISBLOCKING( intent ) ( intent & DRV_IO_INTENT_BLOCKING )
961 // *****************************************************************************
962 /* Device Driver Non Blocking Status Macro
963  Summary:
964  Returns if the I/O intent provided is non-blocking.
965  Description:
966  This macro returns if the I/ intent provided is non-blocking.
967  Remarks:
968  None.
969 */
970 #define DRV_IO_ISNONBLOCKING( intent ) ( intent & DRV_IO_INTENT_NONBLOCKING )
971 // *****************************************************************************
972 /* Device Driver Exclusive Status Macro
973  Summary:
974  Returns if the I/O intent provided is non-blocking.
975  Description:
976  This macro returns if the I/O intent provided is non-blocking.
977  Remarks:
978  None.
979 */
980 #define DRV_IO_ISEXCLUSIVE( intent ) ( intent & DRV_IO_INTENT_EXCLUSIVE )
981 // *****************************************************************************
982 /* Device Driver IO Buffer Identifier
983  Summary:
984  Identifies to which buffer a device operation will apply.
985  Description:
986  This enumeration identifies to which buffer (read, write, both, or neither)
987  a device operation will apply. This is used for "flush" (or similar)
988  operations.
989 */
990 
991 typedef
992  enum
993  {
994  // Operation does not apply to any buffer
996  // Operation applies to read buffer
998  // Operation applies to write buffer
1000  // Operation applies to both read and write buffers
1003 // *****************************************************************************
1004 /* Device Handle
1005  Summary:
1006  Handle to an opened device driver.
1007  Description:
1008  This handle identifies the open instance of a device driver. It must be
1009  passed to all other driver routines (except the initialization, deinitialization,
1010  or power routines) to identify the caller.
1011  Remarks:
1012  Every application or module that wants to use a driver must first call
1013  the driver's open routine. This is the only routine that is absolutely
1014  required for every driver.
1015  If a driver is unable to allow an additional module to use it, it must then
1016  return the special value DRV_HANDLE_INVALID. Callers should check the
1017  handle returned for this value to ensure this value was not returned before
1018  attempting to call any other driver routines using the handle.
1019 */
1020 
1021 typedef
1022 uintptr_t
1024 // *****************************************************************************
1025 /* Invalid Device Handle
1026  Summary:
1027  Invalid device handle.
1028  Description:
1029  If a driver is unable to allow an additional module to use it, it must then
1030  return the special value DRV_HANDLE_INVALID. Callers should check the
1031  handle returned for this value to ensure this value was not returned before
1032  attempting to call any other driver routines using the handle.
1033  Remarks:
1034  None.
1035 */
1036 #define DRV_HANDLE_INVALID ( ( ( DRV_HANDLE ) - 1 ) )
1037 // *****************************************************************************
1038 /* Not supported configuration
1039  Summary:
1040  Not supported configuration.
1041  Description:
1042  If the configuration option is not supported on an instance of the
1043  peripheral, use this macro to equate to that configuration. This option
1044  should be listed as a possible value in the description of that
1045  configuration option.
1046 */
1047 #define DRV_CONFIG_NOT_SUPPORTED ( ( ( unsigned short ) - 1 ) )
1048 // *****************************************************************************
1049 /* Unsupported Attribute Abstraction
1050  Summary:
1051  Abstracts the use of the unsupported attribute defined by the compiler.
1052  Description:
1053  This macro nulls the definition of the _PLIB_UNSUPPORTED macro, to support
1054  compilation of the drivers for all different variants.
1055  Example:
1056  void _PLIB_UNSUPPORTED PLIB_USART_Enable(USART_MODULE_ID index);
1057  This function will not generate a compiler error if the interface is not
1058  defined for the selected device.
1059  Remarks:
1060  None.
1061 */
1062 #define _PLIB_UNSUPPORTED
1063  //_DRV_COMMON_H
1064 /*******************************************************************************
1065  End of File
1066 */
1067 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\driver_common.h*/
1068 /* CLOSE_FILE Include File */
1069 
1070 #include "system/common/sys_module.h"
1071 // *****************************************************************************
1072 /* IC Driver Module Index Numbers
1073  Summary:
1074  IC driver index definitions.
1075  Description:
1076  These constants provide IC Driver index definitions.
1077  Remarks:
1078  These constants should be used in place of hard-coded numeric literals.
1079  These values should be passed into the DRV_IC_Initialize and
1080  DRV_IC_Open routines to identify the driver instance in use.
1081 */
1082 #define DRV_IC_INDEX_0 0
1083 #define DRV_IC_INDEX_1 1
1084 #define DRV_IC_INDEX_2 2
1085 #define DRV_IC_INDEX_3 3
1086 #define DRV_IC_INDEX_4 4
1087 #define DRV_IC_INDEX_5 5
1088 #define DRV_IC_INDEX_6 6
1089 #define DRV_IC_INDEX_7 7
1090 #define DRV_IC_INDEX_8 8
1091 #define DRV_IC_INDEX_9 9
1092 #define DRV_IC_INDEX_10 10
1093 #define DRV_IC_INDEX_11 11
1094 #define DRV_IC_INDEX_12 12
1095 #define DRV_IC_INDEX_13 13
1096 #define DRV_IC_INDEX_14 14
1097 #define DRV_IC_INDEX_15 15
1098 // *****************************************************************************
1099 // *****************************************************************************
1100 // Section: Interface Headers for the static driver
1101 // *****************************************************************************
1102 // *****************************************************************************
1103 // *****************************************************************************
1104 /* Function:
1105  SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index,
1106  const SYS_MODULE_INIT * const init);
1107  Summary:
1108  Initializes the Input Capture instance for the specified driver index.
1109  <p><b>Implementation:</b> Static</p>
1110  Description:
1111  This routine initializes the Input Capture driver instance for the specified
1112  driver instance, making it ready for clients to use it. The initialization
1113  routine is specified by the MHC parameters. The driver instance index is
1114  independent of the Input Capture module ID. For example, driver instance 0
1115  can be assigned to Input Capture 2.
1116  Precondition:
1117  None.
1118  Parameters:
1119  None.
1120  Returns:
1121  None.
1122  Remarks:
1123  This routine must be called before any other Input Capture routine is called.
1124  This routine should only be called once during system initialization.
1125 */
1126 
1127 SYS_MODULE_OBJ
1129  const SYS_MODULE_INDEX index ,
1130  const SYS_MODULE_INIT * const init ) ;
1131 // *****************************************************************************
1132 /* Function:
1133 DRV_HANDLE DRV_IC_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1134  Summary:
1135  Opens the Input Capture instance for the specified driver index.
1136  <p><b>Implementation:</b> Static</p>
1137  Description:
1138  This routine starts the Input Capture driver for the specified driver
1139  index, starting an input capture.
1140  Precondition:
1141  DRV_IC_Initialize has been called.
1142  Parameters:
1143  None.
1144  Returns:
1145  None.
1146  Remarks:
1147  None.
1148 */
1149 
1150 DRV_HANDLE
1151  DRV_IC_Open (
1152  const SYS_MODULE_INDEX drvIndex ,
1153  const DRV_IO_INTENT intent ) ;
1154 // *****************************************************************************
1155 /* Function:
1156  void DRV_IC_Close(DRV_HANDLE handle)
1157  Summary:
1158  Closes the Input Capture instance for the specified driver index.
1159  <p><b>Implementation:</b> Static</p>
1160  Description:
1161  This routine stops the Input Capture driver for the specified driver
1162  index, stopping an input capture.
1163  Precondition:
1164  DRV_IC_Initialize has been called.
1165  Parameters:
1166  None.
1167  Returns:
1168  None.
1169  Remarks:
1170  None.
1171 */
1172 
1173 void
1174  DRV_IC_Close (
1175  DRV_HANDLE handle ) ;
1176 // *****************************************************************************
1177 /* Function:
1178 DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1179  Summary:
1180  Starts the Input Capture instance for the specified driver index.
1181  <p><b>Implementation:</b> Static</p>
1182  Description:
1183  This routine starts the Input Capture driver for the specified driver
1184  index, starting an input capture.
1185  Precondition:
1186  DRV_IC_Initialize has been called.
1187  Parameters:
1188  None.
1189  Returns:
1190  None.
1191  Remarks:
1192  None.
1193 */
1194 
1195 DRV_HANDLE
1196  DRV_IC_Start (
1197  const SYS_MODULE_INDEX drvIndex ,
1198  const DRV_IO_INTENT intent ) ;
1199 // *****************************************************************************
1200 /* Function:
1201  void DRV_IC_Stop(DRV_HANDLE handle)
1202  Summary:
1203  Stops the Input Capture instance for the specified driver index.
1204  <p><b>Implementation:</b> Static</p>
1205  Description:
1206  This routine stops the Input Capture driver for the specified driver
1207  index, stopping an input capture.
1208  Precondition:
1209  DRV_IC_Initialize has been called.
1210  Parameters:
1211  None.
1212  Returns:
1213  None.
1214  Remarks:
1215  None.
1216 */
1217 
1218 void
1219  DRV_IC_Stop (
1220  DRV_HANDLE handle ) ;
1221 // *****************************************************************************
1222 /* Function:
1223  uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
1224  Summary:
1225  Reads the 32-bit Input Capture for the specified driver index.
1226  <p><b>Implementation:</b> Static</p>
1227  Description:
1228  This routine reads the 32-bit data for the specified driver index
1229  Precondition:
1230  DRV_IC_Initialize has been called.
1231  Parameters:
1232  None.
1233  Returns:
1234  uint32_t value of the data read from the Input Capture.
1235  Remarks:
1236  None.
1237 */
1238 
1239 uint32_t
1241  DRV_HANDLE handle ) ;
1242 // *****************************************************************************
1243 /* Function:
1244  uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
1245  Summary:
1246  Reads the 16-bit Input Capture for the specified driver index.
1247  <p><b>Implementation:</b> Static</p>
1248  Description:
1249  This routine reads the 16-bit data for the specified driver index.
1250  Precondition:
1251  DRV_IC_Initialize has been called.
1252  Parameters:
1253  None.
1254  Returns:
1255  uint16_t value of the data read from the Input Capture.
1256  Remarks:
1257  None.
1258 */
1259 
1260 uint16_t
1262  DRV_HANDLE handle ) ;
1263 // *****************************************************************************
1264 /* Function:
1265  bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
1266  Summary:
1267  Returns the Input Capture instance buffer empty status for the specified driver
1268  index.
1269  <p><b>Implementation:</b> Static</p>
1270  Description:
1271  Returns the Input Capture instance buffer empty status for the specified driver
1272  index. The function should be called to determine whether or not the IC buffer
1273  has data.
1274  Precondition:
1275  DRV_IC_Initialize has been called.
1276  Parameters:
1277  None.
1278  Returns:
1279  Boolean
1280  - 1 - Buffer is empty
1281  - 0 - Buffer is not empty
1282  Remarks:
1283  None.
1284 */
1285 
1286 bool
1288  DRV_HANDLE handle ) ;
1289 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h */
1290 /*******************************************************************************
1291  IC Driver Interface Declarations for Static Single Instance Driver
1292  Company:
1293  Microchip Technology Inc.
1294  File Name:
1295  drv_ic_static.h
1296  Summary:
1297  IC driver interface declarations for the static single instance driver.
1298  Description:
1299  The IC device driver provides a simple interface to manage the IC
1300  modules on Microchip microcontrollers. This file defines the interface
1301  Declarations for the IC driver.
1302 
1303  Remarks:
1304  Static interfaces incorporate the driver instance number within the names
1305  of the routines, eliminating the need for an object ID or object handle.
1306 
1307  Static single-open interfaces also eliminate the need for the open handle.
1308 *******************************************************************************/
1309 //DOM-IGNORE-BEGIN
1310 /*******************************************************************************
1311 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1312 Microchip licenses to you the right to use, modify, copy and distribute
1313 Software only when embedded on a Microchip microcontroller or digital signal
1314 controller that is integrated into your product or third party product
1315 (pursuant to the sublicense terms in the accompanying license agreement).
1316 You should refer to the license agreement accompanying this Software for
1317 additional information regarding your rights and obligations.
1318 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1319 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1320 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1321 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1322 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1323 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1324 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1325 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1326 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1327 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1328 *******************************************************************************/
1329 //DOM-IGNORE-END
1330 #ifndef _DRV_IC_STATIC_H
1331 #define _DRV_IC_STATIC_H
1332 #define DRV_IC_Open( drvIndex , intent ) ( drvIndex )
1333 #define DRV_IC_Close( handle )
1334 // *****************************************************************************
1335 // *****************************************************************************
1336 // Section: Interface Headers for Instance 0 for the static driver
1337 // *****************************************************************************
1338 // *****************************************************************************
1339 
1340 void
1341  DRV_IC0_Initialize ( void ) ;
1342 
1343 void
1344  DRV_IC0_Start ( void ) ;
1345 
1346 void
1347  DRV_IC0_Stop ( void ) ;
1348 
1349 uint32_t
1350  DRV_IC0_Capture32BitDataRead ( void ) ;
1351 
1352 uint16_t
1353  DRV_IC0_Capture16BitDataRead ( void ) ;
1354 
1355 bool
1356  DRV_IC0_BufferIsEmpty ( void ) ;
1357  // #ifndef _DRV_IC_STATIC_H
1358 /*******************************************************************************
1359  End of File
1360 */
1361 
1362 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h*/
1363 /* CLOSE_FILE Include File */
1364 
1365  // #ifndef _DRV_IC_H
1366 /*******************************************************************************
1367  End of File
1368 */
1369 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h*/
1370 /* CLOSE_FILE Include File */
1371 
1372 #include "system/devcon/sys_devcon.h"
1373 #include "system/clk/sys_clk.h"
1374 #include "system/int/sys_int.h"
1375 #include "system/tmr/sys_tmr.h"
1376 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h */
1377 /*******************************************************************************
1378  ADC Driver Interface Declarations for Static Single Instance Driver
1379  Company:
1380  Microchip Technology Inc.
1381  File Name:
1382  drv_adc_static.h
1383  Summary:
1384  ADC driver interface declarations for the static single instance driver.
1385  Description:
1386  The ADC device driver provides a simple interface to manage the ADC
1387  modules on Microchip microcontrollers. This file defines the interface
1388  Declarations for the ADC driver.
1389 
1390  Remarks:
1391  Static interfaces incorporate the driver instance number within the names
1392  of the routines, eliminating the need for an object ID or object handle.
1393 
1394  Static single-open interfaces also eliminate the need for the open handle.
1395 *******************************************************************************/
1396 //DOM-IGNORE-BEGIN
1397 /*******************************************************************************
1398 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1399 Microchip licenses to you the right to use, modify, copy and distribute
1400 Software only when embedded on a Microchip microcontroller or digital signal
1401 controller that is integrated into your product or third party product
1402 (pursuant to the sublicense terms in the accompanying license agreement).
1403 You should refer to the license agreement accompanying this Software for
1404 additional information regarding your rights and obligations.
1405 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1406 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1407 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1408 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1409 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1410 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1411 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1412 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1413 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1414 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1415 *******************************************************************************/
1416 //DOM-IGNORE-END
1417 #ifndef _DRV_ADC_STATIC_H
1418 #define _DRV_ADC_STATIC_H
1419 #include <stdbool.h>
1420 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1421 #include "peripheral/adchs/plib_adchs.h"
1422 #include "peripheral/int/plib_int.h"
1423 
1424 typedef
1425  enum
1426  {
1427  DRV_ADC_ID_1 = ADCHS_ID_0 ,
1429  } DRV_ADC_MODULE_ID ;
1430 // *****************************************************************************
1431 // *****************************************************************************
1432 // Section: Interface Headers for ADC Static Driver
1433 // *****************************************************************************
1434 // *****************************************************************************
1435 
1436 void
1437  DRV_ADC_Initialize ( void ) ;
1438 
1439 inline void
1440  DRV_ADC_DeInitialize ( void ) ;
1441 
1442 inline void
1443  DRV_ADC0_Open ( void ) ;
1444 
1445 inline void
1446  DRV_ADC0_Close ( void ) ;
1447 
1448 inline void
1449  DRV_ADC1_Open ( void ) ;
1450 
1451 inline void
1452  DRV_ADC1_Close ( void ) ;
1453 
1454 inline void
1455  DRV_ADC_Start ( void ) ;
1456 
1457 inline void
1458  DRV_ADC_Stop ( void ) ;
1459 
1460 uint32_t
1462  uint8_t bufIndex ) ;
1463 
1464 bool
1466  uint8_t bufIndex ) ;
1467  // #ifndef _DRV_ADC_STATIC_H
1468 /*******************************************************************************
1469  End of File
1470 */
1471 
1472 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h*/
1473 /* CLOSE_FILE Include File */
1474 
1475 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h */
1476 /*******************************************************************************
1477  Timer Driver Interface Declarations for Static Single Instance Driver
1478  Company:
1479  Microchip Technology Inc.
1480  File Name:
1481  drv_tmr_static.h
1482  Summary:
1483  Timer driver interface declarations for the static single instance driver.
1484  Description:
1485  The Timer device driver provides a simple interface to manage the Timer
1486  modules on Microchip microcontrollers. This file defines the interface
1487  Declarations for the TMR driver.
1488 
1489  Remarks:
1490  Static interfaces incorporate the driver instance number within the names
1491  of the routines, eliminating the need for an object ID or object handle.
1492 
1493  Static single-open interfaces also eliminate the need for the open handle.
1494 *******************************************************************************/
1495 //DOM-IGNORE-BEGIN
1496 /*******************************************************************************
1497 Copyright (c) 2014 released Microchip Technology Inc. All rights reserved.
1498 Microchip licenses to you the right to use, modify, copy and distribute
1499 Software only when embedded on a Microchip microcontroller or digital signal
1500 controller that is integrated into your product or third party product
1501 (pursuant to the sublicense terms in the accompanying license agreement).
1502 You should refer to the license agreement accompanying this Software for
1503 additional information regarding your rights and obligations.
1504 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1505 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1506 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTOCULAR PURPOSE.
1507 IN NO EVENT SHALL MOCROCHIP OR ITS LOCENSORS BE LIABLE OR OBLIGATED UNDER
1508 CONTRACT, NEGLIGENCE, STROCT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1509 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1510 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1511 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1512 SUBSTITUTE GOODS, TECHNOLOGY, SERVOCES, OR ANY CLAIMS BY THIRD PARTIES
1513 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1514 *******************************************************************************/
1515 //DOM-IGNORE-END
1516 #ifndef _DRV_TMR_STATIC_H
1517 #define _DRV_TMR_STATIC_H
1518 // *****************************************************************************
1519 // *****************************************************************************
1520 // Section: Include Headers
1521 // *****************************************************************************
1522 // *****************************************************************************
1523 #include <stdint.h>
1524 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h */
1525 /*******************************************************************************
1526  Timer Device Driver Interface Definition
1527  Company:
1528  Microchip Technology Inc.
1529  File Name:
1530  drv_tmr.h
1531  Summary:
1532  Timer device driver interface header file.
1533  Description:
1534  This header file contains the function prototypes and definitions of the
1535  data types and constants that make up the interface to the Timer device
1536  driver.
1537 *******************************************************************************/
1538 //DOM-IGNORE-BEGIN
1539 /*******************************************************************************
1540 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1541 Microchip licenses to you the right to use, modify, copy and distribute
1542 Software only when embedded on a Microchip microcontroller or digital signal
1543 controller that is integrated into your product or third party product
1544 (pursuant to the sublicense terms in the accompanying license agreement).
1545 You should refer to the license agreement accompanying this Software for
1546 additional information regarding your rights and obligations.
1547 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1548 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1549 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1550 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1551 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1552 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1553 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1554 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1555 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1556 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1557 *******************************************************************************/
1558 //DOM-IGNORE-END
1559 #ifndef _DRV_TMR_H
1560 #define _DRV_TMR_H
1561 // *****************************************************************************
1562 // *****************************************************************************
1563 // Section: File includes
1564 // *****************************************************************************
1565 // *****************************************************************************
1566 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1567 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
1568 #include "peripheral/tmr/plib_tmr.h"
1569 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h */
1570 /*******************************************************************************
1571  Timer Device Driver Interface Definition
1572  Company:
1573  Microchip Technology Inc.
1574  File Name:
1575  tmr_definitions_pic32m.h
1576  Summary:
1577  Timer device driver definitions header file.
1578  Description:
1579  This header file contains the definitions of the
1580  data types and constants that make up the interface to the Timer device
1581  driver.
1582 *******************************************************************************/
1583 //DOM-IGNORE-BEGIN
1584 /*******************************************************************************
1585 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1586 Microchip licenses to you the right to use, modify, copy and distribute
1587 Software only when embedded on a Microchip microcontroller or digital signal
1588 controller that is integrated into your product or third party product
1589 (pursuant to the sublicense terms in the accompanying license agreement).
1590 You should refer to the license agreement accompanying this Software for
1591 additional information regarding your rights and obligations.
1592 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1593 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1594 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1595 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1596 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1597 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1598 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1599 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1600 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1601 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1602 *******************************************************************************/
1603 //DOM-IGNORE-END
1604 #ifndef _TMR_DEFINITIONS_PIC32M_H
1605 #define _TMR_DEFINITIONS_PIC32M_H
1606 // DOM-IGNORE-BEGIN
1607 // DOM-IGNORE-END
1608 
1609 typedef
1610  enum
1611  {
1612  /* Clock input to the timer module is internal(Peripheral Clock) */
1614  /*DOM-IGNORE-BEGIN*/
1615  = 0x00 /*DOM-IGNORE-END*/
1616  ,
1617  /* Clock input to the timer module is from T1CK pin (external)
1618  with clock synchronization enabled */
1620  /*DOM-IGNORE-BEGIN*/
1621  = 0x01 /*DOM-IGNORE-END*/
1622  ,
1623  /* Clock input to the timer module is from T1CK pin (external)
1624  with clock synchronization disabled */
1626  /*DOM-IGNORE-BEGIN*/
1627  = 0x11 /*DOM-IGNORE-END*/
1628  ,
1629  /* Clock input to the timer module is from secondary oscillator (external)
1630  with clock synchronization enabled */
1632  /*DOM-IGNORE-BEGIN*/
1633  = 0x02 /*DOM-IGNORE-END*/
1634  ,
1635  /* Clock input to the timer module is from secondary oscillator (external)
1636  with clock synchronization disabled */
1638  /*DOM-IGNORE-BEGIN*/
1639  = 0x12 /*DOM-IGNORE-END*/
1640  ,
1641  /* Clock input to the timer module is from LPRC
1642  with clock synchronization enabled */
1644  /*DOM-IGNORE-BEGIN*/
1645  = 0x03 /*DOM-IGNORE-END*/
1646  ,
1647  /* Clock input to the timer module is from LPRC
1648  with clock synchronization disabled */
1650  /*DOM-IGNORE-BEGIN*/
1651  = 0x13 /*DOM-IGNORE-END*/
1653 //DOM-IGNORE-BEGIN
1654 //DOM-IGNORE-END
1655  // #ifndef _DRV_TMR_H
1656 /*******************************************************************************
1657  End of File
1658 */
1659 
1660 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h*/
1661 /* CLOSE_FILE Include File */
1662 
1663 #include "system/int/sys_int.h" // System Interrupt Definitions
1664 #include "system/clk/sys_clk.h"
1665 // DOM-IGNORE-BEGIN
1666 // DOM-IGNORE-END
1667 // *****************************************************************************
1668 // *****************************************************************************
1669 // Section: TMR Driver Data Types
1670 // *****************************************************************************
1671 // *****************************************************************************
1672 // *****************************************************************************
1673 /* Timer Driver Module Index Numbers
1674  Summary:
1675  Timer driver index definitions
1676  Description:
1677  These constants provide Timer driver index definitions.
1678  Remarks:
1679  These constants should be used in place of hard-coded numeric literals.
1680  These values should be passed into the DRV_TMR_Initialize and DRV_TMR_Open
1681  functions to identify the driver instance in use.
1682 */
1683 #define DRV_TMR_INDEX_0 0
1684 #define DRV_TMR_INDEX_1 1
1685 #define DRV_TMR_INDEX_2 2
1686 #define DRV_TMR_INDEX_3 3
1687 #define DRV_TMR_INDEX_4 4
1688 #define DRV_TMR_INDEX_5 5
1689 #define DRV_TMR_INDEX_6 6
1690 #define DRV_TMR_INDEX_7 7
1691 #define DRV_TMR_INDEX_8 8
1692 #define DRV_TMR_INDEX_9 9
1693 #define DRV_TMR_INDEX_10 10
1694 #define DRV_TMR_INDEX_11 11
1695 // *****************************************************************************
1696 /* Timer Driver Module Index Count
1697  Summary:
1698  Number of valid Timer driver indices.
1699  Description:
1700  This constant identifies Timer driver index definitions.
1701  Remarks:
1702  This constant should be used in place of hard-coded numeric literals.
1703  This value is device-specific.
1704 */
1705 #define DRV_TMR_INDEX_COUNT TMR_NUMBER_OF_MODULES
1706 // *****************************************************************************
1707 /* Timer Driver Client Status
1708  Summary:
1709  Identifies the client-specific status of the Timer driver
1710  Description:
1711  This enumeration identifies the client-specific status of the Timer driver.
1712  Remarks:
1713  None.
1714 */
1715 
1716 typedef
1717  enum
1718  {
1719  /* Driver is invalid (or unopened) state */
1721  /*DOM-IGNORE-BEGIN*/
1722  = DRV_CLIENT_STATUS_ERROR /*DOM-IGNORE-END*/
1723  ,
1724  /* An operation is currently in progress */
1726  /*DOM-IGNORE-BEGIN*/
1727  = DRV_CLIENT_STATUS_BUSY /*DOM-IGNORE-END*/
1728  ,
1729  /* Ready, no operations running */
1731  /*DOM-IGNORE-BEGIN*/
1732  = DRV_CLIENT_STATUS_READY + 0 /*DOM-IGNORE-END*/
1733  ,
1734  /* Timer started and running, processing transactions */
1736  /*DOM-IGNORE-BEGIN*/
1737  = DRV_CLIENT_STATUS_READY + 1 /*DOM-IGNORE-END*/
1739 // *****************************************************************************
1740 /* Timer Driver Clock sources
1741  Summary:
1742  Lists the clock sources available for timer driver.
1743  Description:
1744  This enumeration lists all the available clock sources for the timer
1745  hardware.
1746  Remarks:
1747  Not all modes are available on all devices.
1748  'Synchronization' may not be applicable for all the instances of the timer.
1749  The driver discards the Synchronization mode selected if it is not
1750  applicable for the selected hardware.
1751 */
1752 // *****************************************************************************
1753 /* Timer Driver Operation mode
1754  Summary:
1755  Lists the operation modes available for timer driver.
1756  Description:
1757  This enumeration lists all the available operation modes that are valid for
1758  the timer hardware.
1759  Remarks:
1760  Not all modes are available on all devices.
1761 */
1762 
1763 typedef
1764  enum
1765  {
1766  /* The timer module operating mode none/invalid */
1768  /* The timer module operates in 16 bit mode */
1770  /* The timer module operates in 32 bit mode */
1771  /* This will combine two 16 bit timer modules */
1774 // *****************************************************************************
1775 /* Timer Driver divider operating specification
1776  Summary:
1777  This data structure specifies the divider values that can be obtained by the
1778  timer module.
1779  Description:
1780  This data structure specifies the divider values that can be obtained by the
1781  timer hardware.
1782  Remarks:
1783  None.
1784 */
1785 
1786 typedef
1787  struct
1788  {
1789  /* The minimum divider value that the timer module can obtain */
1790  uint32_t dividerMin ;
1791  /* The maximum divider value that the timer module can obtain */
1792  uint32_t dividerMax ;
1793  /* The divider step value, between 2 divider values */
1794  /* Should be 1 for most timers */
1795  uint32_t dividerStep ;
1797 // *****************************************************************************
1798 /* Timer Driver Initialize Data
1799  Summary:
1800  Defines the Timer driver initialization data.
1801  Description:
1802  This data type defines data required to initialize the Timer driver.
1803  Remarks:
1804  Not all initialization features are available on all devices.
1805 */
1806 
1807 typedef
1808  struct
1809  {
1810  /* System module initialization. */
1811  SYS_MODULE_INIT moduleInit ;
1812  /* Identifies timer hardware module (PLIB-level) ID */
1813  TMR_MODULE_ID tmrId ;
1814  /* Clock Source select. */
1815  DRV_TMR_CLK_SOURCES clockSource ;
1816  /* Prescaler Selection from the processor enumeration */
1817  TMR_PRESCALE prescale ;
1818  /* Interrupt Source for TMR module. If 'DRV_TMR_OPERATION_MODE_32_BIT' flag
1819  is selected the interrupt will be generated by the 2nd timer of the pair,
1820  the odd numbered one. */
1821  INT_SOURCE interruptSource ;
1822  /* Select 16/32 bit operation mode. 32 bit mode will combine two 16 bit
1823  timer modules to form a 32 bit one. This is usually only necessary for
1824  very long delays. */
1825  DRV_TMR_OPERATION_MODE mode ;
1826  /* Asynchronous write enable configuration. If true the asynchronous write
1827  is enabled. For timers that do not support this feature the value is
1828  ignored */
1829  bool asyncWriteEnable ;
1830  } DRV_TMR_INIT ;
1831 // *****************************************************************************
1832 /* Timer Driver Callback Function Pointer
1833  Summary:
1834  Pointer to a Timer driver callback function data type.
1835  Description:
1836  This data type defines a pointer to a Timer driver callback function.
1837  Remarks:
1838  Useful only when timer alarm callback support is enabled by defining the
1839  DRV_TMR_ALARM_ENABLE configuration option.
1840 */
1841 
1842 typedef
1843 void ( * DRV_TMR_CALLBACK ) ( uintptr_t context ,
1844 uint32_t alarmCount ) ;
1845 // *****************************************************************************
1846 // *****************************************************************************
1847 // Section: Timer Driver Module Interface Functions
1848 // *****************************************************************************
1849 // *****************************************************************************
1850 // *****************************************************************************
1851 /* Function:
1852  SYS_MODULE_OBJ DRV_TMR_Initialize
1853  (
1854  const SYS_MODULE_INDEX drvIndex,
1855  const SYS_MODULE_INIT * const init
1856  )
1857  Summary:
1858  Initializes the Timer driver.
1859  <p><b>Implementation:</b> Static/Dynamic</p>
1860  Description:
1861  This function initializes the Timer driver, making it ready for clients to
1862  open and use it.
1863  Precondition:
1864  None.
1865  Parameters:
1866  drvIndex - Index for the driver instance to be initialized
1867  init - Pointer to a data structure containing any data necessary
1868  to initialize the driver.
1869  Returns:
1870  If successful, returns a valid handle to a driver object. Otherwise, it
1871  returns SYS_MODULE_OBJ_INVALID. The returned object must be passed as
1872  argument to DRV_TMR_Deinitialize, DRV_TMR_Tasks and DRV_TMR_Status functions.
1873  Example:
1874  <code>
1875  DRV_TMR_INIT init;
1876  SYS_MODULE_OBJ objectHandle;
1877  // Populate the timer initialization structure
1878  init.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
1879  init.tmrId = TMR_ID_2;
1880  init.clockSource = DRV_TMR_CLKSOURCE_INTERNAL;
1881  init.prescale = TMR_PRESCALE_VALUE_256;
1882  init.interruptSource = INT_SOURCE_TIMER_2;
1883  init.mode = DRV_TMR_OPERATION_MODE_16_BIT;
1884  init.asyncWriteEnable = false;
1885  // Do something
1886  objectHandle = DRV_TMR_Initialize ( DRV_TMR_INDEX_0, (SYS_MODULE_INIT*)&init );
1887  if ( SYS_MODULE_OBJ_INVALID == objectHandle )
1888  {
1889  // Handle error
1890  }
1891  </code>
1892  Remarks:
1893  This function must be called before any other Timer driver function is
1894  called.
1895  This function should only be called once during system initialization unless
1896  DRV_TMR_Deinitialize is called to deinitialize the driver instance.
1897  This function will NEVER block for hardware access. The system must use
1898  DRV_TMR_Status to find out when the driver is in the ready state.
1899  Build configuration options may be used to statically override options in
1900  the "init" structure and will take precedence over initialization data
1901  passed using this function.
1902 */
1903 
1904 SYS_MODULE_OBJ
1906  const SYS_MODULE_INDEX drvIndex ,
1907  const SYS_MODULE_INIT * const init ) ;
1908 // *****************************************************************************
1909 /* Function:
1910  void DRV_TMR_Deinitialize ( SYS_MODULE_OBJ object )
1911  Summary:
1912  Deinitializes the specified instance of the Timer driver.
1913  <p><b>Implementation:</b> Dynamic</p>
1914  Description:
1915  Deinitializes the specified instance of the Timer driver, disabling
1916  its operation (and any hardware). All internal data is invalidated.
1917  Precondition:
1918  The DRV_TMR_Initialize function must have been called before calling this
1919  function and a valid SYS_MODULE_OBJ must have been returned.
1920  Parameters:
1921  object - Driver object handle, returned from DRV_TMR_Initialize
1922  Returns:
1923  None.
1924  Example:
1925  <code>
1926  SYS_MODULE_OBJ tmrObject; // Returned from DRV_TMR_Initialize
1927  SYS_STATUS tmrStatus;
1928  DRV_TMR_Deinitialize ( tmrObject );
1929  tmrStatus = DRV_TMR_Status ( tmrObject );
1930  if ( SYS_MODULE_UNINITIALIZED == tmrStatus )
1931  {
1932  // Check again later if you need to know
1933  // when the driver is deinitialized.
1934  }
1935  </code>
1936  Remarks:
1937  Once the Initialize operation has been called, the Deinitialize operation
1938  must be called before the Initialize operation can be called again.
1939  This function will NEVER block waiting for hardware. If the operation
1940  requires time to allow the hardware to complete, this will be reported by
1941  the DRV_TMR_Status operation. The system has to use DRV_TMR_Status to find
1942  out when the module is in the ready state.
1943 */
1944 
1945 void
1947  SYS_MODULE_OBJ object ) ;
1948 // *****************************************************************************
1949 /* Function:
1950  SYS_STATUS DRV_TMR_Status ( SYS_MODULE_OBJ object )
1951  Summary:
1952  Provides the current status of the Timer driver.
1953  <p><b>Implementation:</b> Dynamic</p>
1954  Description:
1955  This function provides the current status of the Timer driver.
1956  Precondition:
1957  The DRV_TMR_Initialize function must have been called before calling this
1958  function.
1959  Parameters:
1960  object - Driver object handle, returned from DRV_TMR_Initialize
1961  Returns:
1962  SYS_STATUS_READY - Indicates that the driver is initialized and ready
1963  for operation
1964  Note: Any value greater than SYS_STATUS_READY is
1965  also a normal running state in which the driver
1966  is ready to accept new operations.
1967  SYS_STATUS_ERROR - Indicates that the driver is in an error state
1968  Note: Any value less than SYS_STATUS_ERROR is
1969  also an error state.
1970  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been deinitialized
1971  Note: This value is less than SYS_STATUS_ERROR.
1972  Example:
1973  <code>
1974  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
1975  SYS_STATUS tmrStatus;
1976  tmrStatus = DRV_TMR_Status ( object );
1977  else if ( SYS_STATUS_ERROR >= tmrStatus )
1978  {
1979  // Handle error
1980  }
1981  </code>
1982  Remarks:
1983  The this operation can be used to determine when any of the driver's module
1984  level operations has completed.
1985  Once the status operation returns SYS_STATUS_READY, the driver is ready for
1986  operation.
1987  The value of SYS_STATUS_ERROR is negative (-1). Any value less than that is
1988  also an error state.
1989  This function will NEVER block waiting for hardware.
1990 */
1991 
1992 SYS_STATUS
1993  DRV_TMR_Status (
1994  SYS_MODULE_OBJ object ) ;
1995 // *****************************************************************************
1996 /* Function:
1997  void DRV_TMR_Tasks ( SYS_MODULE_OBJ object )
1998  Summary:
1999  Maintains the driver's state machine.
2000  <p><b>Implementation:</b> Dynamic</p>
2001  Description:
2002  This function is used to maintain the driver's internal state machine and
2003  processes the timer events..
2004  Precondition:
2005  The DRV_TMR_Initialize function must have been called for the specified Timer
2006  driver instance.
2007  Parameters:
2008  object - Object handle for the specified driver instance (returned from
2009  DRV_TMR_Initialize)
2010  Returns:
2011  None
2012  Example:
2013  <code>
2014  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
2015  while (true)
2016  {
2017  DRV_TMR_Tasks ( object );
2018  // Do other tasks
2019  }
2020  </code>
2021  Remarks:
2022  This function is normally not called directly by an application. It is
2023  called by the system's Tasks routine (SYS_Tasks)
2024 */
2025 
2026 void
2027  DRV_TMR_Tasks (
2028  SYS_MODULE_OBJ object ) ;
2029 // *****************************************************************************
2030 // *****************************************************************************
2031 // Section: TMR Driver Client Functions
2032 // *****************************************************************************
2033 // *****************************************************************************
2034 // *****************************************************************************
2035 /* Function:
2036  DRV_HANDLE DRV_TMR_Open
2037  (
2038  const SYS_MODULE_INDEX index,
2039  const DRV_IO_INTENT intent
2040  )
2041  Summary:
2042  Opens the specified Timer driver instance and returns a handle to it.
2043  <p><b>Implementation:</b> Dynamic</p>
2044  Description:
2045  This function opens the specified Timer driver instance and provides a
2046  handle that must be provided to all other client-level operations to
2047  identify the caller and the instance of the driver. Timer driver does not
2048  support multiple clients. If two tasks want to use the timer, one should
2049  wait until the other one gets closed.
2050  Precondition:
2051  The DRV_TMR_Initialize function must have been called before calling this
2052  function.
2053  Parameters:
2054  index - Identifier for the object instance to be opened
2055  intent - Zero or more of the values from the enumeration
2056  DRV_IO_INTENT ORed together to indicate the intended use
2057  of the driver
2058  Returns:
2059  If successful, the function returns a valid open instance handle (a number
2060  identifying both the caller and the module instance).
2061  If an error occurs, the return value is DRV_HANDLE_INVALID.
2062  Example:
2063  <code>
2064  DRV_HANDLE handle;
2065  handle = DRV_TMR_Open ( DRV_TMR_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
2066  if ( DRV_HANDLE_INVALID == handle )
2067  {
2068  // Unable to open the driver
2069  }
2070  </code>
2071  Remarks:
2072  The handle returned is valid until the DRV_TMR_Close function is called.
2073  This function will NEVER block waiting for hardware.
2074  If the requested intent flags are not supported, the function will return
2075  DRV_HANDLE_INVALID.
2076  The Timer driver does not support DRV_IO_INTENT_SHARED.
2077  Only exclusive access is supported for now.
2078 */
2079 
2080 DRV_HANDLE
2081  DRV_TMR_Open (
2082  const SYS_MODULE_INDEX index ,
2083  const DRV_IO_INTENT intent ) ;
2084 // *****************************************************************************
2085 /* Function:
2086  void DRV_TMR_Close ( DRV_HANDLE handle )
2087  Summary:
2088  Closes an opened instance of the Timer driver.
2089  <p><b>Implementation:</b> Dynamic</p>
2090  Description:
2091  This function closes an opened instance of the Timer driver, invalidating
2092  the handle.
2093  Precondition:
2094  The DRV_TMR_Initialize function must have been called for the specified
2095  Timer driver instance.
2096  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2097  Parameters:
2098  handle - A valid open-instance handle, returned from the driver's
2099  open routine
2100  Returns:
2101  None
2102  Example:
2103  <code>
2104  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2105  DRV_TMR_Close ( handle );
2106  </code>
2107  Remarks:
2108  After calling this function, the handle passed in "handle" must not be used
2109  with any of the remaining driver functions. A new handle must be obtained
2110  by calling DRV_TMR_Open before the caller may use the driver again.
2111  Note: Usually there is no need for the driver client to verify that the Close
2112  operation has completed.
2113 */
2114 
2115 void
2116  DRV_TMR_Close (
2117  DRV_HANDLE handle ) ;
2118 // *****************************************************************************
2119 /* Function:
2120  DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus ( DRV_HANDLE handle )
2121  Summary:
2122  Gets the status of the client operation.
2123  <p><b>Implementation:</b> Dynamic</p>
2124  Description:
2125  This function gets the status of the recently completed client level
2126  operation.
2127  Precondition:
2128  The DRV_TMR_Initialize function must have been called for the specified
2129  Timer driver instance.
2130  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2131  Parameters:
2132  handle - A valid open-instance handle, returned from the driver's
2133  open routine
2134  Returns:
2135  None
2136  Example:
2137  <code>
2138  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2139  DRV_TMR_CLIENT_STATUS tmrDrvStatus;
2140  tmrDrvStatus = DRV_TMR_ClientStatus ( tmrHandle );
2141  </code>
2142  Remarks:
2143  None.
2144 */
2145 
2148  DRV_HANDLE handle ) ;
2149 // *****************************************************************************
2150 // *****************************************************************************
2151 // Section: TMR Driver Counting functions
2152 // *****************************************************************************
2153 // *****************************************************************************
2154 // *****************************************************************************
2155 /* Function:
2156  void DRV_TMR_CounterValueSet ( DRV_HANDLE handle, uint32_t counterPeriod )
2157  Summary:
2158  Updates the Timer's counter register.
2159  <p><b>Implementation:</b> Static/Dynamic</p>
2160  Description:
2161  This function updates the Timer's value in the counter register.
2162  Precondition:
2163  The DRV_TMR_Initialize function must have been called.
2164  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2165  Parameters:
2166  handle - A valid open-instance handle, returned from the driver's
2167  open routine
2168  counterPeriod - counter period value
2169  - a 16 bit value if the timer is configured in 16 bit mode
2170  - a 32 bit value if the timer is configured in 32 bit mode
2171  Returns:
2172  None.
2173  Example:
2174  <code>
2175  </code>
2176  Remarks:
2177  None.
2178 */
2179 
2180 void
2182  DRV_HANDLE handle ,
2183  uint32_t counterPeriod ) ;
2184 // *****************************************************************************
2185 /* Function:
2186  uint32_t DRV_TMR_CounterValueGet ( DRV_HANDLE handle )
2187  Summary:
2188  Reads the Timer's counter register.
2189  <p><b>Implementation:</b> Static/Dynamic</p>
2190  Description:
2191  This function returns the Timer's value in the counter register.
2192  Precondition:
2193  The DRV_TMR_Initialize function must have been called.
2194  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2195  Parameters:
2196  handle - A valid open-instance handle, returned from the driver's
2197  open routine
2198  Returns:
2199  Timer current period:
2200  - a 16 bit value if the timer is configured in 16 bit mode
2201  - a 32 bit value if the timer is configured in 32 bit mode
2202  Example:
2203  <code>
2204  //Example to use timer for precision time measurement
2205  //without configuring an alarm (interrupt based)
2206  char appState = 0;
2207  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2208  switch ( appState )
2209  {
2210  case 0:
2211  //Calculate and set the counter period
2212  DRV_TMR_CounterValueSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
2213  //counter starts
2214  DRV_TMR_Start ( tmrHandle );
2215  //Trigger an application operation
2216  app_trigger_operation();
2217  //Check for time-out in the next state
2218  appState++;
2219  case 1:
2220  //Overflows and stops at 0 if no alarm is set
2221  if ( DRV_TMR_CounterValueGet ( tmrHandle ) == 0 )
2222  {
2223  //Time-out
2224  return false;
2225  }
2226  else if ( app_operation_isComplete( ) )
2227  {
2228  //Operation is complete before time-out
2229  return true;
2230  }
2231  </code>
2232  Remarks:
2233  None.
2234 */
2235 
2236 uint32_t
2238  DRV_HANDLE handle ) ;
2239 // *****************************************************************************
2240 /* Function:
2241  void DRV_TMR_CounterClear ( DRV_HANDLE handle )
2242  Summary:
2243  Clears the Timer's counter register.
2244  <p><b>Implementation:</b> Static/Dynamic</p>
2245  Description:
2246  This function clears the Timer's value in the counter register.
2247  Precondition:
2248  The DRV_TMR_Initialize function must have been called.
2249  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2250  Parameters:
2251  handle - A valid open-instance handle, returned from the driver's
2252  open routine
2253  Returns:
2254  None.
2255  Example:
2256  <code>
2257  </code>
2258  Remarks:
2259  None.
2260 */
2261 
2262 void
2264  DRV_HANDLE handle ) ;
2265 // *****************************************************************************
2266 /* Function:
2267  bool DRV_TMR_AlarmRegister
2268  (
2269  DRV_HANDLE handle,
2270  uint32_t divider,
2271  bool isPeriodic,
2272  uintptr_t context,
2273  DRV_TMR_CALLBACK callBack
2274  )
2275  Summary:
2276  Sets up an alarm.
2277  <p><b>Implementation:</b> Dynamic</p>
2278  Description:
2279  This function sets up an alarm, allowing the client to receive a callback
2280  from the driver when the timer counter reaches zero. Alarms can be one-shot
2281  or periodic. A periodic alarm will reload the timer and generate alarm
2282  until stopped. The alarm frequency is: DRV_TMR_CounterFrequencyGet() /
2283  divider;
2284  Precondition:
2285  The DRV_TMR_Initialize function must have been called.
2286  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2287  divider value has to be within the timer divider range (see DRV_TMR_DividerSpecGet).
2288  Parameters:
2289  handle - A valid handle, returned from DRV_TMR_Open
2290  divider - The value to divide the timer clock source to obtain the
2291  required alarm frequency.
2292  - a 16 bit value if the timer is configured in 16 bit mode
2293  - a 32 bit value if the timer is configured in 32 bit mode
2294  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
2295  context - A reference, call back function will be called with the same
2296  reference.
2297  callBack - A call back function which will be called on time out.
2298  Returns:
2299  - true - if the call succeeded
2300  - false - the obtained divider could not be obtained or the passed handle was invalid
2301  Example:
2302  <code>
2303  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
2304  void setupTask ()
2305  {
2306  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2307  uint32_t myFreq = 1000; // 1KHz
2308  uint32_t clkFreq = DRV_TMR_CounterFrequencyGet(tmrHandle); // timer running frequency
2309  // calculate the divider needed
2310  uint32_t divider = clkFreq / myFreq;
2311  // Start the alarm
2312  if(!DRV_TMR_AlarmRegister ( tmrHandle, divider, true, 0, CallBackFreq ))
2313  {
2314  // divider value could not be obtain;
2315  // handle the error
2316  //
2317  }
2318  }
2319  </code>
2320  Remarks:
2321  The divider value will be truncated to a 16 bit value if the timer is
2322  configured in 16 bit mode. The timer should be started using DRV_TMR_Start API to get a
2323  callback.
2324 */
2325 
2326 bool
2328  DRV_HANDLE handle ,
2329  uint32_t divider ,
2330  bool isPeriodic ,
2331  uintptr_t context ,
2332  DRV_TMR_CALLBACK callBack ) ;
2333 // *****************************************************************************
2334 /* Function:
2335  bool DRV_TMR_AlarmDisable ( DRV_HANDLE handle);
2336  Summary:
2337  Disables an alarm signal.
2338  <p><b>Implementation:</b> Dynamic</p>
2339  Description:
2340  This function allows the client to disable an alarm generation.
2341  Use DRV_TMR_AlarmEnable to re-enable.
2342  Precondition:
2343  The DRV_TMR_Initialize function must have been called.
2344  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2345  A client alarm must be active.
2346  Parameters:
2347  handle - A valid handle, returned from DRV_TMR_Open
2348  Returns:
2349  The current status of the alarm:
2350  - true if the alarm was currently enabled
2351  - false if the alarm was currently disabled
2352  Example:
2353  <code>
2354  </code>
2355  Remarks:
2356  When the driver operates in interrupts this call resolves to a device
2357  interrupt disable.
2358  Do NOT disable the timer except for very short periods of time. If the time
2359  that the interrupt is disabled is longer than a wrap around period and the
2360  interrupt is missed, the hardware has no means of recovering and the
2361  resulting timing will be inaccurate.
2362 */
2363 
2364 bool
2366  DRV_HANDLE handle ) ;
2367 // *****************************************************************************
2368 /* Function:
2369  void DRV_TMR_AlarmEnable ( DRV_HANDLE handle, bool enable );
2370  Summary:
2371  Re-enables an alarm signal.
2372  <p><b>Implementation:</b> Dynamic</p>
2373  Description:
2374  This function allows the client to re-enable an alarm after it has been
2375  disabled by a DRV_TMR_AlarmDisable call.
2376  Precondition:
2377  The DRV_TMR_Initialize function must have been called.
2378  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2379  Parameters:
2380  handle - A valid handle, returned from DRV_TMR_Open
2381  enable - boolean to enable the current callback
2382  Returns:
2383  None
2384  Example:
2385  <code>
2386  </code>
2387  Remarks:
2388  When the driver operates in interrupts this call resolves to a device
2389  interrupt re-enable.
2390 */
2391 
2392 void
2394  DRV_HANDLE handle ,
2395  bool enable ) ;
2396 // *****************************************************************************
2397 /* Function:
2398  void DRV_TMR_AlarmPeriodSet ( DRV_HANDLE handle, uint32_t value )
2399  Summary:
2400  Updates the Timer's period.
2401  <p><b>Implementation:</b> Dynamic</p>
2402  Description:
2403  This function updates the Timer's period.
2404  Precondition:
2405  The DRV_TMR_Initialize function must have been called.
2406  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2407  Parameters:
2408  handle - A valid open-instance handle, returned from the driver's
2409  open routine
2410  value - Period value
2411  - a 16 bit value if the timer is configured in 16 bit mode
2412  - a 32 bit value if the timer is configured in 32 bit mode
2413  Returns:
2414  None.
2415  Example:
2416  <code>
2417  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2418  DRV_TMR_AlarmPeriodSet ( handle, 0x1000 );
2419  </code>
2420  Remarks:
2421  - The period value will be truncated to a 16 bit value if the timer is
2422  configured in 16 bit mode.
2423 */
2424 
2425 void
2427  DRV_HANDLE handle ,
2428  uint32_t value ) ;
2429 // *****************************************************************************
2430 /* Function:
2431  uint32_t DRV_TMR_AlarmPeriodGet ( DRV_HANDLE handle )
2432  Summary:
2433  Provides the Timer's period.
2434  <p><b>Implementation:</b> Dynamic</p>
2435  Description:
2436  This function gets the Timer's period.
2437  Precondition:
2438  The DRV_TMR_Initialize function must have been called.
2439  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2440  Parameters:
2441  handle - A valid open-instance handle, returned from the driver's
2442  open routine
2443  Returns:
2444  Timer period value:
2445  - a 16 bit value if the timer is configured in 16 bit mode
2446  - a 32 bit value if the timer is configured in 32 bit mode
2447  Example:
2448  <code>
2449  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2450  uint32_t period;
2451  period = DRV_TMR_AlarmPeriodGet ( tmrHandle );
2452  </code>
2453  Remarks:
2454  None.
2455 */
2456 
2457 uint32_t
2459  DRV_HANDLE handle ) ;
2460 // *****************************************************************************
2461 /* Function:
2462  void DRV_TMR_AlarmDeregister ( DRV_HANDLE handle )
2463  Summary:
2464  Removes a previously set alarm.
2465  <p><b>Implementation:</b> Dynamic</p>
2466  Description:
2467  This function removes a previously set alarm.
2468  Precondition:
2469  The DRV_TMR_Initialize function must have been called.
2470  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2471  DRV_TMR_AlarmRegister function must have been called before.
2472  Parameters:
2473  handle - A valid open-instance handle, returned from the driver's
2474  open routine
2475  Returns:
2476  None.
2477  Example:
2478  <code>
2479  // Example of a key debounce check
2480  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
2481  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2482  void keyPressDetect ()
2483  {
2484  // Calculate the count to be passed on from the clock input
2485  DRV_TMR_AlarmRegister ( tmrHandle, 0xFF00, true, DebounceCheck );
2486  }
2487  void DebounceCheck ( uintptr_t context )
2488  {
2489  readKey = AppReadKey();
2490  if ( readKey != lastReadKey )
2491  {
2492  lastReadKey = readKey;
2493  keyCount = 0;
2494  }
2495  else
2496  {
2497  if ( keyCount > 20 )
2498  {
2499  globalKeyState = readKey;
2500  DRV_TMR_AlarmDeregister ( tmrHandle );
2501  }
2502  keyCount++;
2503  }
2504  }
2505  </code>
2506  Remarks:
2507  None.
2508 */
2509 
2510 void
2512  DRV_HANDLE handle ) ;
2513 // *****************************************************************************
2514 // *****************************************************************************
2515 // Section: TMR Driver Operation Control Functions
2516 // *****************************************************************************
2517 // *****************************************************************************
2518 // *****************************************************************************
2519 /* Function:
2520  bool DRV_TMR_Start ( DRV_HANDLE handle )
2521  Summary:
2522  Starts the Timer counting.
2523  <p><b>Implementation:</b> Static/Dynamic</p>
2524  Description:
2525  This function starts the Timer counting.
2526  Precondition:
2527  The DRV_TMR_Initialize function must have been called.
2528  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2529  Timer parameters must have been set by a call to DRV_TMR_AlarmRegister.
2530  Parameters:
2531  handle - A valid open-instance handle, returned from the driver's
2532  open routine
2533  Returns:
2534  - true - if the operation succeeded
2535  - false - the supplied handle is invalid or the client doesn't have
2536  the needed parameters to run (alarm callback and period )
2537  Example:
2538  <code>
2539  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2540  DRV_TMR_AlarmRegister(tmrHandle, 0x100, true, 0, myTmrCallback);
2541  DRV_TMR_Start ( tmrHandle );
2542  </code>
2543  Remarks:
2544  None.
2545 */
2546 
2547 bool
2548  DRV_TMR_Start (
2549  DRV_HANDLE handle ) ;
2550 // *****************************************************************************
2551 /* Function:
2552  void DRV_TMR_Stop ( DRV_HANDLE handle )
2553  Summary:
2554  Stops the Timer from counting.
2555  <p><b>Implementation:</b> Static/Dynamic</p>
2556  Description:
2557  This function stops the running Timer from counting.
2558  Precondition:
2559  The DRV_TMR_Initialize function must have been called.
2560  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2561  Parameters:
2562  handle - A valid open-instance handle, returned from the driver's
2563  open routine
2564  Returns:
2565  None.
2566  Example:
2567  <code>
2568  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2569  DRV_TMR_Stop ( handle );
2570  </code>
2571  Remarks:
2572  None.
2573 */
2574 
2575 void
2576  DRV_TMR_Stop (
2577  DRV_HANDLE handle ) ;
2578 // *****************************************************************************
2579 // *****************************************************************************
2580 // Section: TMR Driver Operation Status Functions
2581 // *****************************************************************************
2582 // *****************************************************************************
2583 // *****************************************************************************
2584 /* Function:
2585  unsigned int DRV_TMR_AlarmHasElapsed ( DRV_HANDLE handle )
2586  Summary:
2587  Provides the status of Timer's period elapse.
2588  <p><b>Implementation:</b> Dynamic</p>
2589  Description:
2590  This function returns the number of times Timer's period has elapsed since
2591  last call to this API has made. On calling this API, the internally
2592  maintained counter will be cleared and count will be started again from next
2593  elapse.
2594  Precondition:
2595  The DRV_TMR_Initialize function must have been called.
2596  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2597  Parameters:
2598  handle - A valid handle, returned from the DRV_TMR_Open
2599  Returns:
2600  Number of times timer has elapsed since the last call.
2601  Example:
2602  <code>
2603  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2604  bool elapseStatus;
2605  SYS_MODULE_OBJ tmrObject // Returned by DRV_TMR_Initialize
2606  unsigned int appInternalTime = 0;
2607  Sys_Tasks()
2608  {
2609  //Timer task will be called from ISR
2610  APP_TimeUpdate_Task();
2611  //Other Tasks
2612  }
2613  void APP_TimeUpdate_Task ( void )
2614  {
2615  //We will not miss a count even though we are late
2616  appInternalTime += DRV_TMR_AlarmHasElapsed ( tmrHandle );
2617  }
2618  </code>
2619  Remarks:
2620  None.
2621 */
2622 
2623 uint32_t
2625  DRV_HANDLE handle ) ;
2626 // *****************************************************************************
2627 // *****************************************************************************
2628 // Section: TMR Driver Control and Information Functions
2629 // *****************************************************************************
2630 // *****************************************************************************
2631 // *****************************************************************************
2632 /* Function:
2633  bool DRV_TMR_ClockSet
2634  (
2635  DRV_HANDLE handle,
2636  DRV_TMR_CLK_SOURCES clockSource,
2637  TMR_PRESCALE preScale
2638  )
2639  Summary:
2640  Sets the timers clock by selecting the source and prescaler.
2641  <p><b>Implementation:</b> Dynamic</p>
2642  Description:
2643  This function sets the timer clock by selecting the source and prescaler.
2644  The clock sources are device specific, refer device datasheet for supported
2645  clock sources. If unsupported clock source is passed then the behaviour of
2646  this function is unpredictable.
2647  Precondition:
2648  The DRV_TMR_Initialize function must have been called. Must have selected
2649  32-Bit timer mode if mode selection is applicable.
2650  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2651  Parameters:
2652  handle - A valid open-instance handle, returned from the driver's
2653  open routine
2654  clockSource - Clock source of the timer
2655  preScale - Timer's Prescaler divisor
2656  Returns:
2657  - true - if the operation is successful
2658  - false - either the handle is invalid or the clockSource
2659  and/or prescaler are not supported
2660  Example:
2661  <code>
2662  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2663  DRV_TMR_ClockSet ( tmrHandle, DRV_TMR_CLKSOURCE_INTERNAL, TMR_PRESCALE_VALUE_256 );
2664  </code>
2665  Remarks:
2666  None.
2667 */
2668 
2669 bool
2671  DRV_HANDLE handle ,
2672  DRV_TMR_CLK_SOURCES clockSource ,
2673  TMR_PRESCALE preScale ) ;
2674 // *****************************************************************************
2675 /* Function:
2676  TMR_PRESCALE DRV_TMR_PrescalerGet ( DRV_HANDLE handle )
2677  Summary:
2678  This function gets the currently selected prescaler.
2679  <p><b>Implementation:</b> Dynamic</p>
2680  Description:
2681  This function gets the currently selected prescaler.
2682  Precondition:
2683  The DRV_TMR_Initialize function must have been called.
2684  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2685  Parameters:
2686  handle - A valid open-instance handle, returned from the driver's
2687  open routine
2688  Returns:
2689  Timer prescaler.
2690  Example:
2691  <code>
2692  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2693  TMR_PRESCALE preScale;
2694  preScale = DRV_TMR_PrescalerGet ( tmrHandle );
2695  </code>
2696  Remarks:
2697  None.
2698 */
2699 
2700 TMR_PRESCALE
2702  DRV_HANDLE handle ) ;
2703 // *****************************************************************************
2704 /* Function:
2705  DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
2706  Summary:
2707  This function gets the currently selected operation mode.
2708  <p><b>Implementation:</b> Dynamic</p>
2709  Description:
2710  This function gets the currently selected 16/32 bit operation mode.
2711  Precondition:
2712  The DRV_TMR_Initialize function must have been called.
2713  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2714  Parameters:
2715  handle - A valid open-instance handle, returned from the driver's
2716  open routine
2717  Returns:
2718  A DRV_TMR_OPERATION_MODE value showing how the timer is currently
2719  configured. DRV_TMR_OPERATION_MODE_NONE is returned for an invalid client
2720  handle.
2721  Example:
2722  <code>
2723  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2724  DRV_TMR_OPERATION_MODE operMode;
2725  operMode = DRV_TMR_OperationModeGet ( tmrHandle );
2726  </code>
2727  Remarks:
2728  None.
2729 */
2730 
2733  DRV_HANDLE handle ) ;
2734 // *****************************************************************************
2735 /* Function:
2736  bool DRV_TMR_GateModeSet ( DRV_HANDLE handle )
2737  Summary:
2738  Enables the Gate mode.
2739  <p><b>Implementation:</b> Dynamic</p>
2740  Description:
2741  This function enables the Gated mode of Timer. User can measure the duration
2742  of an external signal in this mode. Once the Gate mode is enabled, Timer
2743  will start on the raising edge of the external signal. It will keep counting
2744  until the next falling edge.
2745  Precondition:
2746  The DRV_TMR_Initialize function must have been called.
2747  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2748  Parameters:
2749  handle - A valid open-instance handle, returned from the driver's
2750  open routine
2751  Returns:
2752  - true - if the operation is successful
2753  - false - either the handle is invalid or the gate mode
2754  is not supported
2755  Example:
2756  <code>
2757  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2758  DRV_TMR_GateModeSet ( tmrHandle );
2759  </code>
2760  Remarks:
2761  None.
2762 */
2763 
2764 bool
2766  DRV_HANDLE handle ) ;
2767 // *****************************************************************************
2768 /* Function:
2769  bool DRV_TMR_GateModeClear ( DRV_HANDLE handle )
2770  Summary:
2771  Enables the Gate mode.
2772  <p><b>Implementation:</b> Dynamic</p>
2773  Description:
2774  This function enables the Gated mode of Timer. User can measure the duration
2775  of an external signal in this mode. Once the Gate mode is enabled, Timer
2776  will start on the raising edge of the external signal. It will keep counting
2777  until the next falling edge.
2778  Precondition:
2779  The DRV_TMR_Initialize function must have been called.
2780  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2781  Parameters:
2782  handle - A valid open-instance handle, returned from the driver's
2783  open routine
2784  Returns:
2785  - true - if the operation is successful
2786  - false - either the handle is invalid or the gate mode
2787  is not supported
2788  Example:
2789  <code>
2790  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2791  DRV_TMR_GateModeClear ( tmrHandle );
2792  </code>
2793  Remarks:
2794  None.
2795 */
2796 
2797 bool
2799  DRV_HANDLE handle ) ;
2800 // *****************************************************************************
2801 /* Function:
2802  uint32_t DRV_TMR_CounterFrequencyGet ( DRV_HANDLE handle )
2803  Summary:
2804  Provides the Timer input frequency.
2805  <p><b>Implementation:</b> Dynamic</p>
2806  Description:
2807  This function provides the Timer input frequency. Input frequency is the
2808  clock to the Timer register and it is considering the prescaler divisor.
2809  Precondition:
2810  The DRV_TMR_Initialize function must have been called.
2811  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2812  Parameters:
2813  handle - A valid open-instance handle, returned from the driver's
2814  open routine
2815  Returns:
2816  32-bit value corresponding to the running frequency.
2817  If Timer clock source is external, then this function returns 0.
2818  Example:
2819  <code>
2820  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2821  uint32_t clkFreqHz;
2822  clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
2823  </code>
2824  Remarks:
2825  On most processors, the Timer's base frequency is the same as the peripheral
2826  bus clock.
2827 */
2828 
2829 uint32_t
2831  DRV_HANDLE handle ) ;
2832 // *****************************************************************************
2833 /* Function:
2834  DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet
2835  (
2836  DRV_HANDLE handle,
2837  DRV_TMR_DIVIDER_RANGE* pDivRange
2838  )
2839  Summary:
2840  Returns the Timer divider values.
2841  <p><b>Implementation:</b> Dynamic</p>
2842  Description:
2843  This function provides the Timer operating mode and divider range.
2844  Precondition:
2845  The DRV_TMR_Initialize function must have been called.
2846  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2847  Parameters:
2848  handle - A valid open-instance handle, returned from the driver's
2849  open routine
2850  pDivRange - Address to store the timer divider range.
2851  Returns:
2852  - A DRV_TMR_OPERATION_MODE value showing how the timer is currently configured.
2853  The pDivRange is updated with the supported range values.
2854  - DRV_TMR_OPERATION_MODE_NONE for invalid client handle
2855  Example:
2856  <code>
2857  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2858  DRV_TMR_OPERATION_MODE timerMode;
2859  DRV_TMR_DIVIDER_RANGE timerRange;
2860  DRV_TMR_DividerRangeGet(handle, &timerRange);
2861  uint32_t clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
2862  uint32_t maxFreqHz = clkFreqHz / timerRange.dividerMin;
2863  uint32_t minFreqHz = clkFreqHz / timerRange.dividerMax;
2864  </code>
2865  Remarks:
2866  None.
2867 */
2868 
2871  DRV_HANDLE handle ,
2872  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
2873 // *****************************************************************************
2874 // *****************************************************************************
2875 // Section: File includes for the APIs which are required for backward
2876 // compatibility.
2877 // *****************************************************************************
2878 // *****************************************************************************
2879 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h */
2880 /*******************************************************************************
2881  Timer Device Driver Interface Definition
2882  Company:
2883  Microchip Technology Inc.
2884  File Name:
2885  drv_tmr_compatibility.h
2886  Summary:
2887  Timer device driver interface header file.
2888  Description:
2889  This header file contains macro definition for APIs which will be deprecated
2890  later. This header file is included in drv_tmr.h.
2891 *******************************************************************************/
2892 //DOM-IGNORE-BEGIN
2893 /*******************************************************************************
2894 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
2895 Microchip licenses to you the right to use, modify, copy and distribute
2896 Software only when embedded on a Microchip microcontroller or digital signal
2897 controller that is integrated into your product or third party product
2898 (pursuant to the sublicense terms in the accompanying license agreement).
2899 You should refer to the license agreement accompanying this Software for
2900 additional information regarding your rights and obligations.
2901 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
2902 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
2903 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
2904 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
2905 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
2906 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
2907 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
2908 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
2909 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
2910 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
2911 *******************************************************************************/
2912 //DOM-IGNORE-END
2913 #ifndef _DRV_TMR_DEPRECATED_H
2914 #define _DRV_TMR_DEPRECATED_H
2915 // *****************************************************************************
2916 // *****************************************************************************
2917 // Section: File includes
2918 // *****************************************************************************
2919 // *****************************************************************************
2920 // *****************************************************************************
2921 /* Function:
2922  void DRV_TMR_Tasks_ISR ( SYS_MODULE_OBJ object )
2923  Summary:
2924  Maintains the driver's state machine, processes the events and implements
2925  its ISR.
2926  <p><b>Implementation:</b> Dynamic</p>
2927  Description:
2928  This function is used to maintain the driver's internal state machine and
2929  processes the timer events in interrupt-driven implementations
2930  (DRV_TMR_INTERRUPT_MODE == true).
2931  Precondition:
2932  The DRV_TMR_Initialize function must have been called for the specified Timer
2933  driver instance.
2934  Parameters:
2935  object - Object handle for the specified driver instance (returned from
2936  DRV_TMR_Initialize)
2937  Returns:
2938  None
2939  Example:
2940  <code>
2941  void __ISR(_TIMER_2_VECTOR, ipl4) _InterruptHandler_TMR2(void)
2942  {
2943  DRV_TMR_Tasks_ISR(appDrvObjects.drvTmrObject);
2944  }
2945  </code>
2946  Remarks:
2947  This function is normally not called directly by an application.
2948  It is called by the timer driver raw ISR.
2949  This function will execute in an ISR context and will never block or access any
2950  resources that may cause it to block.
2951 
2952  This function will be deprecated later, so avoid using it as much as possible.
2953  Use generic function "DRV_TMR_Tasks" instead of this.
2954 */
2955 #define DRV_TMR_Tasks_ISR( object ) DRV_TMR_Tasks ( object )
2956 // *****************************************************************************
2957 /* Function:
2958  void DRV_TMR_CounterValue16BitSet
2959  (
2960  DRV_HANDLE handle,
2961  uint16_t counterPeriod
2962  )
2963  Summary:
2964  Updates the 16-bit Timer's counter register.
2965  <p><b>Implementation:</b> Dynamic</p>
2966  Description:
2967  This function updates the 16-bit Timer's value in the counter register. This
2968  is valid only if the 16-bit mode of the timer is selected('mode' in the INIT
2969  structure is set to DRV_TMR_OPERATION_MODE_16_BIT). Otherwise use
2970  DRV_TMR_CounterValue32BitSet function.
2971  Precondition:
2972  The DRV_TMR_Initialize function must have been called. Must have selected
2973  16-Bit timer mode if mode selection is applicable.
2974  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2975  Parameters:
2976  handle - A valid open-instance handle, returned from the driver's
2977  open routine
2978  counterPeriod - 16-bit counter period value
2979  Returns:
2980  None.
2981  Example:
2982  <code>
2983  //Example to use timer for precision time measurement
2984  //without configuring an alarm (interrupt based)
2985  char appState = 0;
2986  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2987 
2988  switch ( appState )
2989  {
2990  case 0:
2991  //Calculate and set the counter period
2992  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
2993 
2994  //counter starts
2995  DRV_TMR_Start ( tmrHandle );
2996 
2997  //Trigger an application operation
2998  app_trigger_operation();
2999 
3000  //Check for time-out in the next state
3001  appState++;
3002  case 1:
3003  //Overflows and stops at 0 if no alarm is set
3004  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3005  {
3006  //Time-out
3007  return false;
3008  }
3009  else if ( app_operation_isComplete( ) )
3010  {
3011  //Operation is complete before time-out
3012  return true;
3013  }
3014  </code>
3015  Remarks:
3016  This function will be deprecated later, so avoid using it as much as possible.
3017  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3018 */
3019 #define DRV_TMR_CounterValue16BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3020 // *****************************************************************************
3021 /* Function:
3022  void DRV_TMR_CounterValue32BitSet
3023  (
3024  DRV_HANDLE handle,
3025  uint32_t counterPeriod
3026  )
3027  Summary:
3028  Updates the 32-bit Timer's counter register.
3029  <p><b>Implementation:</b> Dynamic</p>
3030  Description:
3031  This function updates the 32-bit Timer's value in the counter register. This
3032  is valid only if the 32-bit mode of the timer is selected Otherwise use
3033  DRV_TMR_CounterValue16BitSet function.
3034  Precondition:
3035  The DRV_TMR_Initialize function must have been called. Must have selected
3036  32-Bit timer mode.
3037  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3038  Parameters:
3039  handle - A valid open-instance handle, returned from the driver's
3040  open routine
3041  counterPeriod - 32-bit counter period value
3042  Returns:
3043  None.
3044  Example:
3045  <code>
3046  //Example to use timer for precision time measurement
3047  //without configuring an alarm (interrupt based)
3048  char appState = 0;
3049  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3050 
3051  switch ( appState )
3052  {
3053  case 0:
3054  //Calculate and set the counter period
3055  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0xFF343100 ) );
3056 
3057  //counter starts
3058  DRV_TMR_Start ( tmrHandle );
3059 
3060  //Trigger an application operation against which we want to use the time-out
3061  app_trigger_operation();
3062 
3063  //Check for time-out in the next state
3064  appState++;
3065  case 1:
3066  //Overflows and stops at 0 if no alarm is set
3067  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3068  {
3069  //Time-out
3070  return false;
3071  }
3072  else if ( app_operation_isComplete( ) )
3073  {
3074  //Operation is complete before time-out
3075  return true;
3076  }
3077  </code>
3078  Remarks:
3079  In most of the devices only even numbered instances of timer supports
3080  32-bit mode.
3081  This function will be deprecated later, so avoid using it as much as possible.
3082  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3083 */
3084 #define DRV_TMR_CounterValue32BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3085 // *****************************************************************************
3086 /* Function:
3087  uint16_t DRV_TMR_CounterValue16BitGet ( DRV_HANDLE handle )
3088  Summary:
3089  Reads the 16-bit Timer's counter register.
3090  <p><b>Implementation:</b> Dynamic</p>
3091  Description:
3092  This function returns the 16-bit Timer's value in the counter register. This
3093  is valid only if the 16-bit mode of the timer is selected.
3094  Otherwise use DRV_TMR_CounterValue32BitGet function.
3095  Precondition:
3096  The DRV_TMR_Initialize function must have been called. Must have selected
3097  16-Bit timer mode if mode selection is applicable.
3098  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3099  Parameters:
3100  handle - A valid open-instance handle, returned from the driver's
3101  open routine
3102 
3103  Returns:
3104  Timer period in 16-bit mode.
3105  Example:
3106  <code>
3107  //Example to use timer for precision time measurement
3108  //without configuring an alarm (interrupt based)
3109  char appState = 0;
3110  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3111 
3112  switch ( appState )
3113  {
3114  case 0:
3115  //Calculate and set the counter period
3116  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
3117 
3118  //counter starts
3119  DRV_TMR_Start ( tmrHandle );
3120 
3121  //Trigger an application operation
3122  app_trigger_operation();
3123 
3124  //Check for time-out in the next state
3125  appState++;
3126  case 1:
3127  //Overflows and stops at 0 if no alarm is set
3128  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3129  {
3130  //Time-out
3131  return false;
3132  }
3133  else if ( app_operation_isComplete( ) )
3134  {
3135  //Operation is complete before time-out
3136  return true;
3137  }
3138  </code>
3139  Remarks:
3140  This function will be deprecated later, so avoid using it as much as possible.
3141  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3142 */
3143 #define DRV_TMR_CounterValue16BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3144 // *****************************************************************************
3145 /* Function:
3146  uint32_t DRV_TMR_CounterValue32BitGet ( DRV_HANDLE handle )
3147  Summary:
3148  Reads the 32-bit Timer's counter register.
3149  <p><b>Implementation:</b> Dynamic</p>
3150  Description:
3151  This function returns the 32-bit Timer's value in the counter register. This
3152  is valid only if the 32-bit mode of the timer is selected Otherwise use
3153  DRV_TMR_CounterValue16BitGet function.
3154  Precondition:
3155  The DRV_TMR_Initialize function must have been called. Must have selected
3156  32-Bit timer mode.
3157  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3158  Parameters:
3159  handle - A valid open-instance handle, returned from the driver's
3160  open routine
3161 
3162  Returns:
3163  32-Bit Counter value.
3164  Example:
3165  <code>
3166  //Example to use timer for precision time measurement
3167  //without configuring an alarm (interrupt based)
3168  char appState = 0;
3169  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3170 
3171  switch ( appState )
3172  {
3173  case 0:
3174  //Calculate and set the counter period
3175  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0x23321000 ) );
3176 
3177  //counter starts
3178  DRV_TMR_Start ( tmrHandle );
3179 
3180  //Trigger an application operation
3181  app_trigger_operation();
3182 
3183  //Check for time-out in the next state
3184  appState++;
3185  case 1:
3186  //Overflows and stops at 0 if no alarm is set
3187  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3188  {
3189  //Time-out
3190  return false;
3191  }
3192  else if ( app_operation_isComplete( ) )
3193  {
3194  //Operation is complete before time-out
3195  return true;
3196  }
3197  </code>
3198  Remarks:
3199  In most of the devices only even numbered instances of timer supports
3200  32-bit mode.
3201  This function will be deprecated later, so avoid using it as much as possible.
3202  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3203 */
3204 #define DRV_TMR_CounterValue32BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3205 // *****************************************************************************
3206 /* Function:
3207  void DRV_TMR_Alarm16BitRegister
3208  (
3209  DRV_HANDLE handle,
3210  uint16_t period,
3211  bool isPeriodic,
3212  uintptr_t context,
3213  DRV_TMR_CALLBACK callBack
3214  )
3215  Summary:
3216  Sets up an alarm.
3217  <p><b>Implementation:</b> Dynamic</p>
3218  Description:
3219  This function sets up an alarm, allowing the client to receive a callback
3220  from the driver when the counter period elapses. Alarms can be one-shot or
3221  periodic. This API is valid only if the 16-bit mode of the timer is
3222  selected. Otherwise use DRV_TMR_Alarm32BitRegister function.
3223  Precondition:
3224  The DRV_TMR_Initialize function must have been called. Must have selected
3225  16-Bit timer mode if mode selection is applicable.
3226  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3227  Parameters:
3228  handle - A valid handle, returned from DRV_TMR_Open
3229  period - 16-bit period which will be loaded into the Timer hardware register.
3230 
3231  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3232 
3233  context - A reference, call back function will be called with the same
3234  reference.
3235 
3236  callBack - A call back function which will be called on period elapse.
3237 
3238  Returns:
3239  None
3240  Example:
3241  <code>
3242  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3243 
3244  void setupTask ()
3245  {
3246  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3247 
3248  // Calculate the count to be passed on from the clock input
3249  //Periodically toggle LED
3250  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF40, true, 0,
3251  ToggleLedCallBack );
3252  }
3253 
3254  void ToggleLedCallBack ( uintptr_t context )
3255  {
3256  //Toggle
3257  }
3258  </code>
3259  Remarks:
3260  This function will be deprecated later, so avoid using it as much as possible.
3261  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3262 */
3263 #define DRV_TMR_Alarm16BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3264 // *****************************************************************************
3265 /* Function:
3266  void DRV_TMR_Alarm32BitRegister
3267  (
3268  DRV_HANDLE handle,
3269  uint32_t period,
3270  bool isPeriodic,
3271  uintptr_t context,
3272  DRV_TMR_CALLBACK callBack
3273  )
3274  Summary:
3275  Sets up an alarm.
3276  <p><b>Implementation:</b> Dynamic</p>
3277  Description:
3278  This function sets up an alarm, allowing the client to receive a callback
3279  from the driver when the counter period elapses. Alarms can be one-shot or
3280  periodic. This API is valid only if the 32-bit mode of the timer is
3281  selected Otherwise use DRV_TMR_Alarm16BitRegister function.
3282  Precondition:
3283  The DRV_TMR_Initialize function must have been called. Must have selected
3284  32-Bit timer mode.
3285  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3286  Parameters:
3287  handle - A valid handle, returned from DRV_TMR_Open
3288  period - 32-bit period which will be loaded into the Timer hardware register.
3289 
3290  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3291 
3292  context - A reference, call back function will be called with the same
3293  reference.
3294 
3295  callBack - A call back function which will be called on period elapse.
3296 
3297  Returns:
3298  None
3299  Example:
3300  <code>
3301  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3302 
3303  void setupTask ()
3304  {
3305  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3306 
3307  // Calculate the count to be passed on from the clock input
3308  //Periodically toggle LED
3309  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFFFFFF00, true, 0,
3310  ToggleLedCallBack );
3311  }
3312 
3313  void ToggleLedCallBack ( uintptr_t context )
3314  {
3315  //Toggle
3316  }
3317  </code>
3318  Remarks:
3319  In most of the devices only even numbered instances of timer supports
3320  32-bit mode.
3321  This function will be deprecated later, so avoid using it as much as possible.
3322  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3323 */
3324 #define DRV_TMR_Alarm32BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3325 // *****************************************************************************
3326 /* Function:
3327  void DRV_TMR_AlarmPeriod16BitSet ( DRV_HANDLE handle, uint16_t value )
3328  Summary:
3329  Updates the 16-bit Timer's period.
3330  <p><b>Implementation:</b> Dynamic</p>
3331  Description:
3332  This function updates the 16-bit Timer's period. This API is valid only if
3333  the 16-bit mode of the timer is selected
3334  Otherwise use DRV_TMR_AlarmPeriod32BitSet function.
3335  Precondition:
3336  The DRV_TMR_Initialize function must have been called. Must have selected
3337  16-Bit timer mode if mode selection is applicable.
3338  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3339  Parameters:
3340  handle - A valid open-instance handle, returned from the driver's
3341  open routine
3342  value - 16-bit Period value
3343  Returns:
3344  None.
3345  Example:
3346  <code>
3347  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3348  DRV_TMR_AlarmPeriod16BitSet ( handle, 0x1000 );
3349  </code>
3350  Remarks:
3351  This function will be deprecated later, so avoid using it as much as possible.
3352  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3353 */
3354 #define DRV_TMR_AlarmPeriod16BitSet( handle , value ) DRV_TMR_AlarmPeriodSet ( handle , value )
3355 // *****************************************************************************
3356 /* Function:
3357  void DRV_TMR_AlarmPeriod32BitSet ( DRV_HANDLE handle, uint32_t period )
3358  Summary:
3359  Updates the 32-bit Timer's period.
3360  <p><b>Implementation:</b> Dynamic</p>
3361  Description:
3362  This function updates the 32-bit Timer's period. This API is valid only if
3363  the 32-bit mode of the timer is selected
3364  Otherwise use DRV_TMR_AlarmPeriod16BitSet function.
3365  Precondition:
3366  The DRV_TMR_Initialize unction must have been called. Must have selected
3367  32-Bit timer mode.
3368  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3369  Parameters:
3370  handle - A valid open-instance handle, returned from the driver's
3371  open routine
3372  period - 32-bit Period value
3373  Returns:
3374  None.
3375  Example:
3376  <code>
3377  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3378  DRV_TMR_AlarmPeriod32BitSet ( handle, 0xFFFFFF00 );
3379  </code>
3380  Remarks:
3381  In most of the devices only even numbered instances of timer supports
3382  32-bit mode.
3383  This function will be deprecated later, so avoid using it as much as possible.
3384  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3385 */
3386 #define DRV_TMR_AlarmPeriod32BitSet( handle , period ) DRV_TMR_AlarmPeriodSet ( handle , period )
3387 // *****************************************************************************
3388 /* Function:
3389  uint16_t DRV_TMR_AlarmPeriod16BitGet ( DRV_HANDLE handle )
3390  Summary:
3391  Provides the 16-bit Timer's period.
3392  <p><b>Implementation:</b> Dynamic</p>
3393  Description:
3394  This function gets the 16-bit Timer's period. This API is valid only if
3395  the 16-bit mode of the timer is selected.
3396  Otherwise use DRV_TMR_AlarmPeriod32BitGet function.
3397  Precondition:
3398  The DRV_TMR_Initialize function must have been called. Must have selected
3399  16-Bit timer mode if mode selection is applicable.
3400  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3401  Parameters:
3402  handle - A valid open-instance handle, returned from the driver's
3403  open routine
3404  Returns:
3405  16-bit timer period value
3406  Example:
3407  <code>
3408  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3409  uint16_t period;
3410 
3411  period = DRV_TMR_AlarmPeriod16BitGet ( tmrHandle );
3412  </code>
3413  Remarks:
3414  This function will be deprecated later, so avoid using it as much as possible.
3415  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3416 */
3417 #define DRV_TMR_AlarmPeriod16BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3418 // *****************************************************************************
3419 /* Function:
3420  uint32_t DRV_TMR_AlarmPeriod32BitGet ( DRV_HANDLE handle )
3421  Summary:
3422  Provides the 32-bit Timer's period.
3423  <p><b>Implementation:</b> Dynamic</p>
3424  Description:
3425  This function gets the 32-bit Timer's period. This API is valid only if
3426  the 32-bit mode of the timer is selected
3427  Otherwise use DRV_TMR_AlarmPeriod16BitGet function.
3428  Precondition:
3429  The DRV_TMR_Initialize function must have been called. Must have selected
3430  32-Bit timer mode.
3431  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3432  Parameters:
3433  handle - A valid open-instance handle, returned from the driver's
3434  open routine
3435  Returns:
3436  32-bit Timer period value.
3437  Example:
3438  <code>
3439  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3440  uint32_t period;
3441  period = DRV_TMR_AlarmPeriod32BitGet ( handle );
3442  </code>
3443  Remarks:
3444  In most of the devices only even numbered instances of timer supports
3445  32-bit mode.
3446  This function will be deprecated later, so avoid using it as much as possible.
3447  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3448 */
3449 #define DRV_TMR_AlarmPeriod32BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3450 // *****************************************************************************
3451 /* Function:
3452  void DRV_TMR_Alarm16BitDeregister ( DRV_HANDLE handle )
3453  Summary:
3454  Removes a previously set alarm.
3455  <p><b>Implementation:</b> Dynamic</p>
3456  Description:
3457  This function removes a previously set alarm. This API is valid only if
3458  the 16-bit mode of the timer is selected
3459  Otherwise use DRV_TMR_Alarm32BitDeregister function.
3460  Precondition:
3461  The DRV_TMR_Initialize function must have been called. Must have selected
3462  16-Bit timer mode if mode selection is applicable.
3463  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3464 
3465  DRV_TMR_Alarm16BitRegister function must have been called before.
3466  Parameters:
3467  handle - A valid open-instance handle, returned from the driver's
3468  open routine
3469  Returns:
3470  None.
3471  Example:
3472  <code>
3473  //Example of a key debounce check
3474 
3475  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3476  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3477  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3478 
3479  void keyPressDetect ()
3480  {
3481  // Calculate the count to be passed on from the clock input
3482  //Periodically toggle LED
3483  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF00, true,
3484  DebounceCheck );
3485  }
3486 
3487  void DebounceCheck ( uintptr_t context )
3488  {
3489  readKey = AppReadKey();
3490 
3491  if ( readKey != lastReadKey )
3492  {
3493  lastReadKey = readKey;
3494  keyCount = 0;
3495  }
3496  else
3497  {
3498  if ( keyCount > 20 )
3499  {
3500  globalKeyState = readKey;
3501  DRV_TMR_Alarm16BitDeregister ( tmrHandle );
3502  }
3503  keyCount++;
3504  }
3505  }
3506  </code>
3507  Remarks:
3508  This function will be deprecated later, so avoid using it as much as possible.
3509  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3510 */
3511 #define DRV_TMR_Alarm16BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3512 // *****************************************************************************
3513 /* Function:
3514  void DRV_TMR_Alarm32BitDeregister ( DRV_HANDLE handle )
3515  Summary:
3516  Removes a previously set alarm.
3517  <p><b>Implementation:</b> Dynamic</p>
3518  Description:
3519  This function removes a previously set alarm. This API is valid only if
3520  the 32-bit mode of the timer is selected
3521  Otherwise use DRV_TMR_Alarm16BitDeregister function.
3522  Precondition:
3523  The DRV_TMR_Initialize function must have been called. Must have selected
3524  32-Bit timer mode if mode selection is applicable.
3525  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3526 
3527  DRV_TMR_Alarm32BitRegister function must have been called before.
3528  Parameters:
3529  handle - A valid open-instance handle, returned from the driver's
3530  open routine
3531  Returns:
3532  None.
3533  Example:
3534  <code>
3535  //Example of a key debounce check
3536 
3537  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3538  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3539  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3540 
3541  void keyPressDetect ( void )
3542  {
3543  // Calculate the count to be passed on from the clock input
3544  //Periodically check the key status
3545  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFF0FFD20, true, 0,
3546  DebounceCheck );
3547  }
3548 
3549  void DebounceCheck ( uintptr_t context )
3550  {
3551  readKey = AppReadKey();
3552 
3553  if ( readKey != lastReadKey )
3554  {
3555  lastReadKey = readKey;
3556  keyCount = 0;
3557  }
3558  else
3559  {
3560  if ( keyCount > 20 )
3561  {
3562  //Key is stable now
3563  globalKeyState = readKey;
3564  DRV_TMR_Alarm32BitDeregister ( tmrHandle );
3565  }
3566  keyCount++;
3567  }
3568  }
3569  </code>
3570  Remarks:
3571  In most of the devices only even numbered instances of timer supports
3572  32-bit mode.
3573  This function will be deprecated later, so avoid using it as much as possible.
3574  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3575 */
3576 #define DRV_TMR_Alarm32BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3577  // #ifndef _DRV_TMR_DEPRECATED_H
3578 /*******************************************************************************
3579  End of File
3580 */
3581 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h*/
3582 /* CLOSE_FILE Include File */
3583 
3584 //DOM-IGNORE-BEGIN
3585 //DOM-IGNORE-END
3586  // #ifndef _DRV_TMR_H
3587 /*******************************************************************************
3588  End of File
3589 */
3590 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h*/
3591 /* CLOSE_FILE Include File */
3592 
3593 #include "peripheral/tmr/plib_tmr.h"
3594 #include "peripheral/int/plib_int.h"
3595 // maximum divider value for 32 bit operation mode
3596 #define DRV_TIMER_DIVIDER_MAX_32BIT 0xffffffff
3597 // minimum divider value for 32 bit operation mode
3598 #define DRV_TIMER_DIVIDER_MIN_32BIT 0x2
3599 // maximum divider value for 16 bit operation mode
3600 #define DRV_TIMER_DIVIDER_MAX_16BIT 0x10000
3601 // minimum divider value for 16 bit operation mode
3602 #define DRV_TIMER_DIVIDER_MIN_16BIT 0x2
3603 // *****************************************************************************
3604 // *****************************************************************************
3605 // Section: Interface Headers for Instance 0 for the static driver
3606 // *****************************************************************************
3607 // *****************************************************************************
3608 
3609 void
3610  DRV_TMR0_Initialize ( void ) ;
3611 
3612 bool
3613  DRV_TMR0_Start ( void ) ;
3614 
3615 void
3616  DRV_TMR0_Stop ( void ) ;
3617 
3618 static inline void
3620  {
3621  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 0))); /* 37 */
3622  DRV_TMR0_Stop () ;
3623  ((int)(bitmapstruct.element0 |= (1 << 1))); /* 30 */
3624  USB_62zqendz ( 2 ) ; /* 30 */
3625  }
3626 
3627 static inline SYS_STATUS
3629 {
3630  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 2))); /* 37 */
3631  /* Return the status as ready always */
3632  ((int)(bitmapstruct.element0 |= (1 << 3))); /* 30 */
3633  USB_62zqendz ( 4 ) ; /* 30 */
3634  return
3635  SYS_STATUS_READY ;
3636 }
3637 
3638 static inline void
3639  DRV_TMR0_Open ( void )
3640  {
3641  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 4))); /* 37 */
3642  ((int)(bitmapstruct.element0 |= (1 << 5))); /* 30 */
3643  USB_62zqendz ( 6 ) ; /* 30 */
3644  }
3645 
3647  DRV_TMR0_ClientStatus ( void ) ;
3648 
3649 static inline DRV_TMR_OPERATION_MODE
3651 {
3652  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 6))); /* 37 */
3653  ((int)(bitmapstruct.element0 |= (1 << 7))); /* 30 */
3654  USB_62zqendz ( 8 ) ; /* 30 */
3655  return
3657 }
3658 
3659 static inline void
3661  {
3662  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 8))); /* 37 */
3663  DRV_TMR0_Stop () ;
3664  ((int)(bitmapstruct.element0 |= (1 << 9))); /* 30 */
3665  USB_62zqendz ( 10 ) ; /* 30 */
3666  }
3667 
3668 bool
3670  DRV_TMR_CLK_SOURCES clockSource ,
3671  TMR_PRESCALE prescale ) ;
3672 
3673 void
3675  uint32_t value ) ;
3676 
3677 uint32_t
3678  DRV_TMR0_CounterValueGet ( void ) ;
3679 
3680 void
3681  DRV_TMR0_CounterClear ( void ) ;
3682 
3683 TMR_PRESCALE
3684  DRV_TMR0_PrescalerGet ( void ) ;
3685 
3686 void
3688  uint32_t value ) ;
3689 
3690 uint32_t
3691  DRV_TMR0_PeriodValueGet ( void ) ;
3692 
3693 void
3694  DRV_TMR0_StopInIdleDisable ( void ) ;
3695 
3696 void
3697  DRV_TMR0_StopInIdleEnable ( void ) ;
3698 
3699 static inline void
3701  {
3702  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 10))); /* 37 */
3703  ((int)(bitmapstruct.element0 |= (1 << 11))); /* 30 */
3704  USB_62zqendz ( 12 ) ; /* 30 */
3705  }
3706 
3707 uint32_t
3708  DRV_TMR0_CounterFrequencyGet ( void ) ;
3709 
3712  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3713 // *****************************************************************************
3714 // *****************************************************************************
3715 // Section: Interface Headers for Instance 1 for the static driver
3716 // *****************************************************************************
3717 // *****************************************************************************
3718 
3719 void
3720  DRV_TMR1_Initialize ( void ) ;
3721 
3722 bool
3723  DRV_TMR1_Start ( void ) ;
3724 
3725 void
3726  DRV_TMR1_Stop ( void ) ;
3727 
3728 static inline void
3730  {
3731  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 12))); /* 37 */
3732  DRV_TMR1_Stop () ;
3733  ((int)(bitmapstruct.element0 |= (1 << 13))); /* 30 */
3734  USB_62zqendz ( 14 ) ; /* 30 */
3735  }
3736 
3737 static inline SYS_STATUS
3739 {
3740  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 14))); /* 37 */
3741  /* Return the status as ready always */
3742  ((int)(bitmapstruct.element0 |= (1 << 15))); /* 30 */
3743  USB_62zqendz ( 16 ) ; /* 30 */
3744  return
3745  SYS_STATUS_READY ;
3746 }
3747 
3748 static inline void
3749  DRV_TMR1_Open ( void )
3750  {
3751  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 16))); /* 37 */
3752  ((int)(bitmapstruct.element0 |= (1 << 17))); /* 30 */
3753  USB_62zqendz ( 18 ) ; /* 30 */
3754  }
3755 
3757  DRV_TMR1_ClientStatus ( void ) ;
3758 
3759 static inline DRV_TMR_OPERATION_MODE
3761 {
3762  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 18))); /* 37 */
3763  ((int)(bitmapstruct.element0 |= (1 << 19))); /* 30 */
3764  USB_62zqendz ( 20 ) ; /* 30 */
3765  return
3767 }
3768 
3769 static inline void
3771  {
3772  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 20))); /* 37 */
3773  DRV_TMR1_Stop () ;
3774  ((int)(bitmapstruct.element0 |= (1 << 21))); /* 30 */
3775  USB_62zqendz ( 22 ) ; /* 30 */
3776  }
3777 
3778 bool
3780  DRV_TMR_CLK_SOURCES clockSource ,
3781  TMR_PRESCALE prescale ) ;
3782 
3783 void
3785  uint32_t value ) ;
3786 
3787 uint32_t
3788  DRV_TMR1_CounterValueGet ( void ) ;
3789 
3790 void
3791  DRV_TMR1_CounterClear ( void ) ;
3792 
3793 TMR_PRESCALE
3794  DRV_TMR1_PrescalerGet ( void ) ;
3795 
3796 void
3798  uint32_t value ) ;
3799 
3800 uint32_t
3801  DRV_TMR1_PeriodValueGet ( void ) ;
3802 
3803 void
3804  DRV_TMR1_StopInIdleDisable ( void ) ;
3805 
3806 void
3807  DRV_TMR1_StopInIdleEnable ( void ) ;
3808 
3809 static inline void
3811  {
3812  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 22))); /* 37 */
3813  ((int)(bitmapstruct.element0 |= (1 << 23))); /* 30 */
3814  USB_62zqendz ( 24 ) ; /* 30 */
3815  }
3816 
3817 uint32_t
3818  DRV_TMR1_CounterFrequencyGet ( void ) ;
3819 
3822  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3823 // *****************************************************************************
3824 // *****************************************************************************
3825 // Section: Interface Headers for Instance 2 for the static driver
3826 // *****************************************************************************
3827 // *****************************************************************************
3828 
3829 void
3830  DRV_TMR2_Initialize ( void ) ;
3831 
3832 bool
3833  DRV_TMR2_Start ( void ) ;
3834 
3835 void
3836  DRV_TMR2_Stop ( void ) ;
3837 
3838 static inline void
3840  {
3841  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 24))); /* 37 */
3842  DRV_TMR2_Stop () ;
3843  ((int)(bitmapstruct.element0 |= (1 << 25))); /* 30 */
3844  USB_62zqendz ( 26 ) ; /* 30 */
3845  }
3846 
3847 static inline SYS_STATUS
3849 {
3850  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 26))); /* 37 */
3851  /* Return the status as ready always */
3852  ((int)(bitmapstruct.element0 |= (1 << 27))); /* 30 */
3853  USB_62zqendz ( 28 ) ; /* 30 */
3854  return
3855  SYS_STATUS_READY ;
3856 }
3857 
3858 static inline void
3859  DRV_TMR2_Open ( void )
3860  {
3861  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 28))); /* 37 */
3862  ((int)(bitmapstruct.element0 |= (1 << 29))); /* 30 */
3863  USB_62zqendz ( 30 ) ; /* 30 */
3864  }
3865 
3867  DRV_TMR2_ClientStatus ( void ) ;
3868 
3869 static inline DRV_TMR_OPERATION_MODE
3871 {
3872  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 30))); /* 37 */
3873  ((int)(bitmapstruct.element0 |= (1 << 31))); /* 30 */
3874  USB_62zqendz ( 32 ) ; /* 30 */
3875  return
3877 }
3878 
3879 static inline void
3881  {
3882  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 0))); /* 37 */
3883  DRV_TMR2_Stop () ;
3884  ((int)(bitmapstruct.element1 |= (1 << 1))); /* 30 */
3885  USB_62zqendz ( 34 ) ; /* 30 */
3886  }
3887 
3888 bool
3890  DRV_TMR_CLK_SOURCES clockSource ,
3891  TMR_PRESCALE prescale ) ;
3892 
3893 void
3895  uint32_t value ) ;
3896 
3897 uint32_t
3898  DRV_TMR2_CounterValueGet ( void ) ;
3899 
3900 void
3901  DRV_TMR2_CounterClear ( void ) ;
3902 
3903 TMR_PRESCALE
3904  DRV_TMR2_PrescalerGet ( void ) ;
3905 
3906 void
3908  uint32_t value ) ;
3909 
3910 uint32_t
3911  DRV_TMR2_PeriodValueGet ( void ) ;
3912 
3913 void
3914  DRV_TMR2_StopInIdleDisable ( void ) ;
3915 
3916 void
3917  DRV_TMR2_StopInIdleEnable ( void ) ;
3918 
3919 static inline void
3921  {
3922  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 2))); /* 37 */
3923  ((int)(bitmapstruct.element1 |= (1 << 3))); /* 30 */
3924  USB_62zqendz ( 36 ) ; /* 30 */
3925  }
3926 
3927 uint32_t
3928  DRV_TMR2_CounterFrequencyGet ( void ) ;
3929 
3932  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3933 // *****************************************************************************
3934 // *****************************************************************************
3935 // Section: Interface Headers for Instance 3 for the static driver
3936 // *****************************************************************************
3937 // *****************************************************************************
3938 
3939 void
3940  DRV_TMR3_Initialize ( void ) ;
3941 
3942 bool
3943  DRV_TMR3_Start ( void ) ;
3944 
3945 void
3946  DRV_TMR3_Stop ( void ) ;
3947 
3948 static inline void
3950  {
3951  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 4))); /* 37 */
3952  DRV_TMR3_Stop () ;
3953  ((int)(bitmapstruct.element1 |= (1 << 5))); /* 30 */
3954  USB_62zqendz ( 38 ) ; /* 30 */
3955  }
3956 
3957 static inline SYS_STATUS
3959 {
3960  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 6))); /* 37 */
3961  /* Return the status as ready always */
3962  ((int)(bitmapstruct.element1 |= (1 << 7))); /* 30 */
3963  USB_62zqendz ( 40 ) ; /* 30 */
3964  return
3965  SYS_STATUS_READY ;
3966 }
3967 
3968 static inline void
3969  DRV_TMR3_Open ( void )
3970  {
3971  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 8))); /* 37 */
3972  ((int)(bitmapstruct.element1 |= (1 << 9))); /* 30 */
3973  USB_62zqendz ( 42 ) ; /* 30 */
3974  }
3975 
3977  DRV_TMR3_ClientStatus ( void ) ;
3978 
3979 static inline DRV_TMR_OPERATION_MODE
3981 {
3982  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 10))); /* 37 */
3983  ((int)(bitmapstruct.element1 |= (1 << 11))); /* 30 */
3984  USB_62zqendz ( 44 ) ; /* 30 */
3985  return
3987 }
3988 
3989 static inline void
3991  {
3992  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 12))); /* 37 */
3993  DRV_TMR3_Stop () ;
3994  ((int)(bitmapstruct.element1 |= (1 << 13))); /* 30 */
3995  USB_62zqendz ( 46 ) ; /* 30 */
3996  }
3997 
3998 bool
4000  DRV_TMR_CLK_SOURCES clockSource ,
4001  TMR_PRESCALE prescale ) ;
4002 
4003 void
4005  uint32_t value ) ;
4006 
4007 uint32_t
4008  DRV_TMR3_CounterValueGet ( void ) ;
4009 
4010 void
4011  DRV_TMR3_CounterClear ( void ) ;
4012 
4013 TMR_PRESCALE
4014  DRV_TMR3_PrescalerGet ( void ) ;
4015 
4016 void
4018  uint32_t value ) ;
4019 
4020 uint32_t
4021  DRV_TMR3_PeriodValueGet ( void ) ;
4022 
4023 void
4024  DRV_TMR3_StopInIdleDisable ( void ) ;
4025 
4026 void
4027  DRV_TMR3_StopInIdleEnable ( void ) ;
4028 
4029 static inline void
4031  {
4032  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 14))); /* 37 */
4033  ((int)(bitmapstruct.element1 |= (1 << 15))); /* 30 */
4034  USB_62zqendz ( 48 ) ; /* 30 */
4035  }
4036 
4037 uint32_t
4038  DRV_TMR3_CounterFrequencyGet ( void ) ;
4039 
4042  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4043 // *****************************************************************************
4044 // *****************************************************************************
4045 // Section: Interface Headers for Instance 4 for the static driver
4046 // *****************************************************************************
4047 // *****************************************************************************
4048 
4049 void
4050  DRV_TMR4_Initialize ( void ) ;
4051 
4052 bool
4053  DRV_TMR4_Start ( void ) ;
4054 
4055 void
4056  DRV_TMR4_Stop ( void ) ;
4057 
4058 static inline void
4060  {
4061  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 16))); /* 37 */
4062  DRV_TMR4_Stop () ;
4063  ((int)(bitmapstruct.element1 |= (1 << 17))); /* 30 */
4064  USB_62zqendz ( 50 ) ; /* 30 */
4065  }
4066 
4067 static inline SYS_STATUS
4069 {
4070  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 18))); /* 37 */
4071  /* Return the status as ready always */
4072  ((int)(bitmapstruct.element1 |= (1 << 19))); /* 30 */
4073  USB_62zqendz ( 52 ) ; /* 30 */
4074  return
4075  SYS_STATUS_READY ;
4076 }
4077 
4078 static inline void
4079  DRV_TMR4_Open ( void )
4080  {
4081  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 20))); /* 37 */
4082  ((int)(bitmapstruct.element1 |= (1 << 21))); /* 30 */
4083  USB_62zqendz ( 54 ) ; /* 30 */
4084  }
4085 
4087  DRV_TMR4_ClientStatus ( void ) ;
4088 
4089 static inline DRV_TMR_OPERATION_MODE
4091 {
4092  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 22))); /* 37 */
4093  ((int)(bitmapstruct.element1 |= (1 << 23))); /* 30 */
4094  USB_62zqendz ( 56 ) ; /* 30 */
4095  return
4097 }
4098 
4099 static inline void
4101  {
4102  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 24))); /* 37 */
4103  DRV_TMR4_Stop () ;
4104  ((int)(bitmapstruct.element1 |= (1 << 25))); /* 30 */
4105  USB_62zqendz ( 58 ) ; /* 30 */
4106  }
4107 
4108 bool
4110  DRV_TMR_CLK_SOURCES clockSource ,
4111  TMR_PRESCALE prescale ) ;
4112 
4113 void
4115  uint32_t value ) ;
4116 
4117 uint32_t
4118  DRV_TMR4_CounterValueGet ( void ) ;
4119 
4120 void
4121  DRV_TMR4_CounterClear ( void ) ;
4122 
4123 TMR_PRESCALE
4124  DRV_TMR4_PrescalerGet ( void ) ;
4125 
4126 void
4128  uint32_t value ) ;
4129 
4130 uint32_t
4131  DRV_TMR4_PeriodValueGet ( void ) ;
4132 
4133 void
4134  DRV_TMR4_StopInIdleDisable ( void ) ;
4135 
4136 void
4137  DRV_TMR4_StopInIdleEnable ( void ) ;
4138 
4139 static inline void
4141  {
4142  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 26))); /* 37 */
4143  ((int)(bitmapstruct.element1 |= (1 << 27))); /* 30 */
4144  USB_62zqendz ( 60 ) ; /* 30 */
4145  }
4146 
4147 uint32_t
4148  DRV_TMR4_CounterFrequencyGet ( void ) ;
4149 
4152  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4153  // #ifndef _DRV_TMR_STATIC_H
4154 /*******************************************************************************
4155  End of File
4156 */
4157 
4158 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h*/
4159 /* CLOSE_FILE Include File */
4160 
4161 #include "peripheral/int/plib_int.h"
4162 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h */
4163 /*******************************************************************************
4164  PMP Driver Interface Declarations for Static Single Instance Driver
4165  Company:
4166  Microchip Technology Inc.
4167  File Name:
4168  drv_pmp_static.h
4169  Summary:
4170  PMP driver interface declarations for the static single instance driver.
4171  Description:
4172  The PMP device driver provides a simple interface to manage the PMP
4173  modules on Microchip microcontrollers. This file defines the interface
4174  Declarations for the PMP driver.
4175 
4176  Remarks:
4177  Static interfaces incorporate the driver instance number within the names
4178  of the routines, eliminating the need for an object ID or object handle.
4179 
4180  Static single-open interfaces also eliminate the need for the open handle.
4181 *******************************************************************************/
4182 //DOM-IGNORE-BEGIN
4183 /*******************************************************************************
4184 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
4185 Microchip licenses to you the right to use, modify, copy and distribute
4186 Software only when embedded on a Microchip microcontroller or digital signal
4187 controller that is integrated into your product or third party product
4188 (pursuant to the sublicense terms in the accompanying license agreement).
4189 You should refer to the license agreement accompanying this Software for
4190 additional information regarding your rights and obligations.
4191 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4192 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4193 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4194 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4195 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4196 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4197 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4198 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4199 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4200 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4201 *******************************************************************************/
4202 //DOM-IGNORE-END
4203 #ifndef _DRV_PMP_STATIC_H
4204 #define _DRV_PMP_STATIC_H
4205 #include "peripheral/pmp/plib_pmp.h"
4206 // *****************************************************************************
4207 // *****************************************************************************
4208 // Section: Interface Headers for Instance 0 for the static driver
4209 // *****************************************************************************
4210 // *****************************************************************************
4211 
4212 void
4213  DRV_PMP0_Initialize ( void ) ;
4214 
4215 void
4216  DRV_PMP0_ModeConfig ( void ) ;
4217 
4218 void
4220  PMP_DATA_WAIT_STATES dataWait ,
4221  PMP_STROBE_WAIT_STATES strobeWait ,
4222  PMP_DATA_HOLD_STATES dataHold ) ;
4223 
4224 uint8_t
4225  DRV_PMP0_Read ( void ) ;
4226 
4227 void
4228  DRV_PMP0_Write (
4229  uint8_t data ) ;
4230  // #ifndef _DRV_PMP_STATIC_H
4231 /*******************************************************************************
4232  End of File
4233 */
4234 
4235 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h*/
4236 /* CLOSE_FILE Include File */
4237 
4238 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h */
4239 /*******************************************************************************
4240  USART Driver Interface Declarations for Static Single Instance Driver
4241  Company:
4242  Microchip Technology Inc.
4243  File Name:
4244  drv_usart_static.h
4245  Summary:
4246  USART driver interface declarations for the static single instance driver.
4247  Description:
4248  The USART device driver provides a simple interface to manage the USART
4249  modules on Microchip microcontrollers. This file defines the interface
4250  Declarations for the USART static driver.
4251  Remarks:
4252  Static interfaces incorporate the driver instance number within the names
4253  of the routines, eliminating the need for an object ID or object handle.
4254  Static single-open interfaces also eliminate the need for the open handle.
4255 *******************************************************************************/
4256 //DOM-IGNORE-BEGIN
4257 /*******************************************************************************
4258 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4259 Microchip licenses to you the right to use, modify, copy and distribute
4260 Software only when embedded on a Microchip microcontroller or digital signal
4261 controller that is integrated into your product or third party product
4262 (pursuant to the sublicense terms in the accompanying license agreement).
4263 You should refer to the license agreement accompanying this Software for
4264 additional information regarding your rights and obligations.
4265 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4266 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4267 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4268 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4269 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4270 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4271 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4272 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4273 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4274 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4275 *******************************************************************************/
4276 //DOM-IGNORE-END
4277 #ifndef _DRV_USART_STATIC_H
4278 #define _DRV_USART_STATIC_H
4279 // *****************************************************************************
4280 // *****************************************************************************
4281 // Section: Included Files
4282 // *****************************************************************************
4283 // *****************************************************************************
4284 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h */
4285 /*******************************************************************************
4286  USART Driver Local Data Structures for static implementation
4287  Company:
4288  Microchip Technology Inc.
4289  File Name:
4290  drv_usart_static_local.h
4291  Summary:
4292  USART Driver Local Data Structures for static implementation
4293  Description:
4294  Driver Local Data Structures for static implementation
4295 *******************************************************************************/
4296 //DOM-IGNORE-BEGIN
4297 /*******************************************************************************
4298 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4299 Microchip licenses to you the right to use, modify, copy and distribute Software
4300 only when embedded on a Microchip microcontroller or digital signal controller
4301 that is integrated into your product or third party product (pursuant to the
4302 sublicense terms in the accompanying license agreement).
4303 You should refer to the license agreement accompanying this Software for
4304 additional information regarding your rights and obligations.
4305 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4306 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4307 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4308 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4309 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4310 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4311 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4312 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4313 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4314 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4315 *******************************************************************************/
4316 //DOM-IGNORE-END
4317 #ifndef _DRV_USART_STATIC_LOCAL_H
4318 #define _DRV_USART_STATIC_LOCAL_H
4319 // *****************************************************************************
4320 // *****************************************************************************
4321 // Section: Included Files
4322 // *****************************************************************************
4323 // *****************************************************************************
4324 #include <stdint.h>
4325 #include <stdbool.h>
4326 #include <stddef.h>
4327 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h */
4328 /*******************************************************************************
4329  USART Driver Interface Header File
4330  Company:
4331  Microchip Technology Inc.
4332  File Name:
4333  drv_usart.h
4334  Summary:
4335  USART Driver Interface Header File
4336  Description:
4337  The USART device driver provides a simple interface to manage the USART or
4338  UART modules on Microchip microcontrollers. This file provides the
4339  interface definition for the USART driver.
4340 *******************************************************************************/
4341 //DOM-IGNORE-BEGIN
4342 /*******************************************************************************
4343 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4344 Microchip licenses to you the right to use, modify, copy and distribute
4345 Software only when embedded on a Microchip microcontroller or digital signal
4346 controller that is integrated into your product or third party product
4347 (pursuant to the sublicense terms in the accompanying license agreement).
4348 You should refer to the license agreement accompanying this Software for
4349 additional information regarding your rights and obligations.
4350 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4351 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4352 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4353 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4354 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4355 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4356 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4357 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4358 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4359 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4360 *******************************************************************************/
4361 //DOM-IGNORE-END
4362 #ifndef _DRV_USART_H
4363 #define _DRV_USART_H
4364 // *****************************************************************************
4365 // *****************************************************************************
4366 // Section: File includes
4367 // *****************************************************************************
4368 // *****************************************************************************
4369 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h */
4370 /*******************************************************************************
4371  USART Driver Definitions Header File
4372  Company:
4373  Microchip Technology Inc.
4374  File Name:
4375  drv_usart_definitions.h
4376  Summary:
4377  USART Driver Definitions Header File
4378  Description:
4379  This file will provide enumerations and other dependencies needed by
4380  USART driver to manage the USART/UART module on PIC32 microcontrollers.
4381 *******************************************************************************/
4382 //DOM-IGNORE-BEGIN
4383 /*******************************************************************************
4384 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4385 Microchip licenses to you the right to use, modify, copy and distribute
4386 Software only when embedded on a Microchip microcontroller or digital signal
4387 controller that is integrated into your product or third party product
4388 (pursuant to the sublicense terms in the accompanying license agreement).
4389 You should refer to the license agreement accompanying this Software for
4390 additional information regarding your rights and obligations.
4391 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4392 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4393 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4394 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4395 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4396 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4397 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4398 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4399 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4400 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4401 *******************************************************************************/
4402 //DOM-IGNORE-END
4403 #ifndef _DRV_USART_DEFINITIONS_H
4404 #define _DRV_USART_DEFINITIONS_H
4405 // *****************************************************************************
4406 // *****************************************************************************
4407 // Section: File includes
4408 // *****************************************************************************
4409 // *****************************************************************************
4410 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
4411 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
4412 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h */
4413 /*******************************************************************************
4414  USART Peripheral Library Interface Header
4415  Company:
4416  Microchip Technology Inc.
4417  File Name:
4418  plib_usart.h
4419  Summary:
4420  USART Peripheral Library interface header.
4421  Description:
4422  This header file contains the function prototypes and definitions of
4423  the data types and constants that make up the interface to the USART
4424  Peripheral Library for all families of Microchip microcontrollers. The
4425  functions in this file are common to the USART module.
4426  *******************************************************************************/
4427 // DOM-IGNORE-BEGIN
4428 /*******************************************************************************
4429 Copyright 2010-2015 released Microchip Technology Inc. All rights reserved.
4430 Microchip licenses to you the right to use, modify, copy and distribute
4431 Software only when embedded on a Microchip microcontroller or digital signal
4432 controller that is integrated into your product or third party product
4433 (pursuant to the sublicense terms in the accompanying license agreement).
4434 You should refer to the license agreement accompanying this Software for
4435 additional information regarding your rights and obligations.
4436 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4437 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4438 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4439 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4440 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4441 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4442 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4443 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4444 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4445 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4446  *******************************************************************************/
4447 // DOM-IGNORE-END
4448 #ifndef _PLIB_USART_H
4449 #define _PLIB_USART_H
4450 // DOM-IGNORE-BEGIN
4451 // DOM-IGNORE-END
4452 // ****************************************************************************
4453 // ****************************************************************************
4454 // Section: Included Files
4455 // ****************************************************************************
4456 // ****************************************************************************
4457 /* This section lists the other files that are included in this file.
4458 */
4459 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h */
4460 /*******************************************************************************
4461  Processor Selector File for the USART
4462  Company:
4463  Microchip Technology Incorporated
4464  File Name:
4465  processor.h
4466  Summary:
4467  Selects the appropriate header for the part family
4468  Description:
4469  This file selects the appropriate header for the part family
4470  *******************************************************************************/
4471 // DOM-IGNORE-BEGIN
4472 /*******************************************************************************
4473 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
4474 Microchip licenses to you the right to use, modify, copy and distribute
4475 Software only when embedded on a Microchip microcontroller or digital signal
4476 controller that is integrated into your product or third party product
4477 (pursuant to the sublicense terms in the accompanying license agreement).
4478 You should refer to the license agreement accompanying this Software for
4479 additional information regarding your rights and obligations.
4480 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4481 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4482 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4483 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4484 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4485 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4486 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4487 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4488 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4489 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4490  *******************************************************************************/
4491 // DOM-IGNORE-END
4492 #ifndef _USART_PROCESSOR_H
4493 #define _USART_PROCESSOR_H
4494 // *****************************************************************************
4495 // *****************************************************************************
4496 // Section: Included Files
4497 // *****************************************************************************
4498 // *****************************************************************************
4499 /* This section lists the other files that are included in this file.
4500  */
4501 #include <stdint.h>
4502 #include <stdbool.h>
4503 #error "No Processor Family specified"
4504  //
4505  // _USART_PROCESSOR_H
4506 /*******************************************************************************
4507  End of File
4508  */
4509 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h*/
4510 /* CLOSE_FILE Include File */
4511 
4512 // ****************************************************************************
4513 // ****************************************************************************
4514 // Section: USART Peripheral Library Interface Functions
4515 // ****************************************************************************
4516 // ****************************************************************************
4517 //******************************************************************************
4518 /* Function:
4519  void PLIB_USART_RunInOverflowEnable ( USART_MODULE_ID index )
4520  Summary:
4521  Enables the USART module to continue to operate when an overflow error
4522  condition has occurred.
4523  Description:
4524  This function enables the USART module to continue to operate when an
4525  overflow error condition has occurred.
4526  This operation is atomic.
4527  Precondition:
4528  None.
4529  Parameters:
4530  index - Identifier for the device instance to be configured
4531  Returns:
4532  None.
4533  Example:
4534  <code>
4535 #define MY_USART_INSTANCE USART_ID_1
4536  PLIB_USART_RunInOverflowEnable (MY_USART_INSTANCE);
4537  </code>
4538  Remarks:
4539  This feature may not be available on all devices. Please refer to the
4540  specific device data sheet to determine availability or use
4541  PLIB_USART_ExistsRunInOverflow in your application to determine
4542  whether this feature is available.
4543 */
4544 
4545 void
4547  USART_MODULE_ID index ) ;
4548 //******************************************************************************
4549 /* Function:
4550  void PLIB_USART_RunInOverflowDisable ( USART_MODULE_ID index )
4551  Summary:
4552  Disables the Run in overflow condition mode.
4553  Description:
4554  This function disables the USART module from accepting new data when an overflow
4555  error condition is detected.
4556  This operation is atomic.
4557  Precondition:
4558  None.
4559  Parameters:
4560  index - Identifier for the device instance to be configured
4561  Returns:
4562  None.
4563  Example:
4564  <code>
4565 #define MY_USART_INSTANCE USART_ID_1
4566  PLIB_USART_RunInOverflowDisable (MY_USART_INSTANCE);
4567  </code>
4568  Remarks:
4569  This feature may not be available on all devices. Please refer to the
4570  specific device data sheet to determine availability or use
4571  PLIB_USART_ExistsRunInOverflow in your application to determine
4572  whether this feature is available.
4573 */
4574 
4575 void
4577  USART_MODULE_ID index ) ;
4578 //******************************************************************************
4579 /* Function:
4580  bool PLIB_USART_RunInOverflowIsEnabled ( USART_MODULE_ID index )
4581  Summary:
4582  Gets the status of the Run in Overflow condition.
4583  Description:
4584  This function indicates if the USART module has been enabled to run in
4585  an overflow condition.
4586  This operation is atomic.
4587  Precondition:
4588  None.
4589  Parameters:
4590  index - Identifier for the device instance
4591  Returns:
4592  - true - Run in overflow condition is enabled
4593  - false - Run in overflow condition is disabled
4594  Example:
4595  <code>
4596 #define MY_USART_INSTANCE USART_ID_1
4597  bool status;
4598  status = PLIB_USART_RunInOverflowIsEnabled (MY_USART_INSTANCE);
4599  </code>
4600  Remarks:
4601  This feature may not be available on all devices. Please refer to the
4602  specific device data sheet to determine availability or use
4603  PLIB_USART_ExistsRunInOverflow in your application to determine
4604  whether this feature is available.
4605 */
4606 
4607 bool
4609  USART_MODULE_ID index ) ;
4610 //******************************************************************************
4611 /* Function:
4612  void PLIB_USART_BRGClockSourceSelect
4613  (
4614  USART_MODULE_ID index,
4615  USART_BRG_CLOCK_SOURCE brgClockSource
4616  )
4617  Summary:
4618  Configures the BRG clock source of the USART module.
4619  Description:
4620  This function configures the BRG Clock source of the USART. Refer to
4621  USART_BRG_CLOCK_SOURCE for the possible clock sources.
4622  Precondition:
4623  None.
4624  Parameters:
4625  index - Identifier for the device instance to be configured
4626  brgClockSource - One of the possible values from USART_BRG_CLOCK_SOURCE
4627  Returns:
4628  None.
4629  Example:
4630  <code>
4631 #define MY_USART_INSTANCE USART_ID_1
4632  PLIB_USART_BRGClockSourceSelect (MY_USART_INSTANCE, USART_BRG_CLOCK_SOURCE_FRC_IN_SLEEP);
4633  </code>
4634  Remarks:
4635  This feature may not be available on all devices. Please refer to the
4636  specific device data sheet to determine availability or use
4637  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
4638  whether this feature is available.
4639 */
4640 
4641 void
4643  USART_MODULE_ID index ,
4644  USART_BRG_CLOCK_SOURCE brgClockSource ) ;
4645 //******************************************************************************
4646 /* Function:
4647  USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet ( USART_MODULE_ID index )
4648  Summary:
4649  Gets the BRG clock source of the USART module.
4650  Description:
4651  This function returns the BRG Clock source of the USART. Refer to
4652  USART_BRG_CLOCK_SOURCE for the possible clock sources.
4653  This operation is atomic.
4654  Precondition:
4655  None.
4656  Parameters:
4657  index - Identifier for the device instance
4658  Returns:
4659  One of the possible values of USART_BRG_CLOCK_SOURCE
4660  Example:
4661  <code>
4662 #define MY_USART_INSTANCE USART_ID_1
4663  USART_BRG_CLOCK_SOURCE brgClockSource;
4664  brgClockSource = PLIB_USART_BRGClockSourceGet (MY_USART_INSTANCE);
4665  </code>
4666  Remarks:
4667  This feature may not be available on all devices. Please refer to the
4668  specific device data sheet to determine availability or use
4669  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
4670  whether this feature is available.
4671 */
4672 
4673 USART_BRG_CLOCK_SOURCE
4675  USART_MODULE_ID index ) ;
4676 //******************************************************************************
4677 /* Function:
4678  bool PLIB_USART_ModuleIsBusy ( USART_MODULE_ID index )
4679  Summary:
4680  Returns the USART module's running status.
4681  Description:
4682  This function checks if the USART module status is busy. The following
4683  functions should not be used when the module status is busy:
4684  - PLIB_USART_LineControlModeSelect
4685  - PLIB_USART_BaudRateHighSet
4686  - PLIB_USART_BaudRateHighEnable
4687  - PLIB_USART_BaudRateHighDisable
4688  - PLIB_USART_ReceiverIdleStateLowEnable
4689  - PLIB_USART_ReceiverIdleStateLowDisable
4690  - PLIB_USART_BaudRateAutoDetectEnable
4691  - PLIB_USART_LoopbackEnable
4692  - PLIB_USART_LoopbackDisable
4693  - PLIB_USART_WakeOnStartEnable
4694  - PLIB_USART_WakeOnStartDisable
4695  - PLIB_USART_OperationModeSelect
4696  - PLIB_USART_HandshakeModeSelect
4697  - PLIB_USART_IrDAEnable
4698  - PLIB_USART_IrDADisable
4699  - PLIB_USART_StopInIdleEnable
4700  - PLIB_USART_StopInIdleDisable
4701  - PLIB_USART_RunInOverflowEnable
4702  - PLIB_USART_RunInOverflowDisable
4703  - PLIB_USART_BRGClockSourceSelect
4704  - PLIB_USART_RunInSleepModeEnable
4705  - PLIB_USART_RunInSleepModeDisable
4706  This operation is atomic.
4707  Precondition:
4708  None.
4709  Parameters:
4710  index - Identifier for the device instance
4711  Returns:
4712  - true - USART module is busy
4713  - false - USART module is idle
4714  Example:
4715  <code>
4716 #define MY_USART_INSTANCE USART_ID_1
4717  bool moduleStatus;
4718  moduleStatus = PLIB_USART_ModuleIsBusy (MY_USART_INSTANCE);
4719  </code>
4720  Remarks:
4721  This feature may not be available on all devices. Please refer to the
4722  specific device data sheet to determine availability or use
4723  PLIB_USART_ExistsModuleBusyStatus in your application to determine
4724  whether this feature is available.
4725 */
4726 
4727 bool
4729  USART_MODULE_ID index ) ;
4730 //******************************************************************************
4731 /* Function:
4732  void PLIB_USART_RunInSleepModeEnable ( USART_MODULE_ID index )
4733  Summary:
4734  Allows the USART module's BRG clock to run when the device enters Sleep mode.
4735  Description:
4736  This function enables the USART module's BRG clock to continue operation when
4737  the device enters the Sleep mode.
4738  This operation is atomic.
4739  Precondition:
4740  None.
4741  Parameters:
4742  index - Identifier for the device instance to be configured
4743  Returns:
4744  None.
4745  Example:
4746  <code>
4747 #define MY_USART_INSTANCE USART_ID_1
4748  PLIB_USART_RunInSleepModeEnable (MY_USART_INSTANCE);
4749  </code>
4750  Remarks:
4751  This feature may not be available on all devices. Please refer to the
4752  specific device data sheet to determine availability or use
4753  PLIB_USART_ExistsRunInSleepMode in your application to determine
4754  whether this feature is available.
4755 */
4756 
4757 void
4759  USART_MODULE_ID index ) ;
4760 //******************************************************************************
4761 /* Function:
4762  void PLIB_USART_RunInSleepModeDisable ( USART_MODULE_ID index )
4763  Summary:
4764  Turns off the USART module's BRG clock during Sleep mode.
4765  Description:
4766  This function turns off the USART module's BRG clock during Sleep mode.
4767  This operation is atomic.
4768  Precondition:
4769  None.
4770  Parameters:
4771  index - Identifier for the device instance to be configured
4772  Returns:
4773  None.
4774  Example:
4775  <code>
4776 #define MY_USART_INSTANCE USART_ID_1
4777  PLIB_USART_RunInSleepModeDisable (MY_USART_INSTANCE);
4778  </code>
4779  Remarks:
4780  This feature may not be available on all devices. Please refer to the
4781  specific device data sheet to determine availability or use
4782  PLIB_USART_ExistsRunInSleepMode in your application to determine
4783  whether this feature is available.
4784 */
4785 
4786 void
4788  USART_MODULE_ID index ) ;
4789 //******************************************************************************
4790 /* Function:
4791  bool PLIB_USART_RunInSleepModeIsEnabled ( USART_MODULE_ID index )
4792  Summary:
4793  Gets the status of Run in Sleep mode.
4794  Description:
4795  This function indicates if the USART module has been enabled to run in
4796  Sleep mode.
4797  This operation is atomic.
4798  Precondition:
4799  None.
4800  Parameters:
4801  index - Identifier for the device instance
4802  Returns:
4803  - true - Run in Sleep mode is enabled
4804  - false - Run in Sleep mode is disabled
4805  Example:
4806  <code>
4807 #define MY_USART_INSTANCE USART_ID_1
4808  bool status;
4809  status = PLIB_USART_RunInSleepModeIsEnabled (MY_USART_INSTANCE);
4810  </code>
4811  Remarks:
4812  This feature may not be available on all devices. Please refer to the
4813  specific device data sheet to determine availability or use
4814  PLIB_USART_ExistsRunInSleepMode in your application to determine
4815  whether this feature is available.
4816 */
4817 
4818 bool
4820  USART_MODULE_ID index ) ;
4821 //******************************************************************************
4822 /* Function:
4823  void PLIB_USART_Enable ( USART_MODULE_ID index )
4824  Summary:
4825  Enables the specific USART module.
4826  Description:
4827  This function enables the specific USART module.
4828  This operation is atomic.
4829  Precondition:
4830  None.
4831  Parameters:
4832  index - Identifier for the device instance to be configured
4833  Returns:
4834  None.
4835  Example:
4836  <code>
4837 #define MY_USART_INSTANCE USART_ID_1
4838  PLIB_USART_Enable(MY_USART_INSTANCE);
4839  </code>
4840  Remarks:
4841  By calling this function, the USART pins are controlled by the USART
4842  module.
4843  This feature may not be available on all devices. Please refer to the
4844  specific device data sheet to determine availability or use
4845  PLIB_USART_ExistsEnable in your application to determine whether
4846  this feature is available.
4847 */
4848 
4849 void
4851  USART_MODULE_ID index ) ;
4852 //******************************************************************************
4853 /* Function:
4854  void PLIB_USART_Disable ( USART_MODULE_ID index )
4855  Summary:
4856  Disables the specific USART module
4857  Description:
4858  This function disables the specific USART module.
4859  This operation is atomic.
4860  Precondition:
4861  None.
4862  Parameters:
4863  index - Identifier for the device instance to be configured
4864  Returns:
4865  None.
4866  Example:
4867  <code>
4868 #define MY_USART_INSTANCE USART_ID_1
4869  PLIB_USART_Disable(MY_USART_INSTANCE);
4870  </code>
4871  Remarks:
4872  The default state after any reset for a USART module is the disable state.
4873  If the USART is disabled, all of the related pins are in control of the
4874  general purpose I/O logic.
4875 
4876  Disabling the USART module resets the buffers to empty states. Any data
4877  characters in the buffers are lost and the baud rate is reset. All error
4878  and status bits are also reset.
4879 
4880  Disabling the USART while the USART is active, will abort all pending
4881  transmissions and receptions. Re-enabling the USART will restart the
4882  module in the same configuration.
4883 
4884  When disabled, the USART power consumption is minimal.
4885  This feature may not be available on all devices. Please refer to the
4886  specific device data sheet to determine availability or use
4887  PLIB_USART_ExistsEnable in your application to determine whether
4888  this feature is available.
4889 */
4890 
4891 void
4893  USART_MODULE_ID index ) ;
4894 //******************************************************************************
4895 /* Function:
4896  void PLIB_USART_TransmitterEnable ( USART_MODULE_ID index )
4897  Summary:
4898  Enables the specific USART module transmitter.
4899  Description:
4900  This function enables the specific USART module transmitter.
4901  This operation is atomic.
4902  Precondition:
4903  The USART module should be enabled using the function PLIB_USART_Enable
4904  before this function is called.
4905  Parameters:
4906  index - Identifier for the device instance to be configured
4907  Returns:
4908  None.
4909  Example:
4910  <code>
4911 #define MY_USART_INSTANCE USART_ID_1
4912  PLIB_USART_TransmitterEnable(MY_USART_INSTANCE);
4913  </code>
4914  Remarks:
4915  The transmitter should not be enabled until the USART is enabled.
4916  The transmissions will not be enabled otherwise.
4917 
4918  This feature may not be available on all devices. Please refer to the
4919  specific device data sheet to determine availability or use
4920  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
4921  this feature is available.
4922 */
4923 
4924 void
4926  USART_MODULE_ID index ) ;
4927 //******************************************************************************
4928 /* Function:
4929  void PLIB_USART_TransmitterDisable ( USART_MODULE_ID index )
4930  Summary:
4931  Disables the specific USART module transmitter.
4932  Description:
4933  This function disables the specific USART module transmitter.
4934  This operation is atomic.
4935  Precondition:
4936  None.
4937  Parameters:
4938  index - Identifier for the device instance to be configured
4939  Returns:
4940  None.
4941  Example:
4942  <code>
4943 #define MY_USART_INSTANCE USART_ID_1
4944  PLIB_USART_TransmitterDisable(MY_USART_INSTANCE);
4945  </code>
4946  Remarks:
4947  Disabling the transmitter during a transmission will cause the
4948  transmission to be aborted.
4949 
4950  This feature may not be available on all devices. Please refer to the
4951  specific device data sheet to determine availability or use
4952  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
4953  this feature is available.
4954 */
4955 
4956 void
4958  USART_MODULE_ID index ) ;
4959 //******************************************************************************
4960 /* Function:
4961  void PLIB_USART_BaudRateSet ( USART_MODULE_ID index, uint32_t clockFrequency,
4962  uint32_t baudRate );
4963  Summary:
4964  Sets the baud rate to the desired value.
4965  Description:
4966  This function sets the baud rate to the desired value.
4967  Precondition:
4968  None.
4969  Parameters:
4970  index - Identifier for the device instance to be configured
4971  baudRate - Baud Rate Value
4972  clockFrequency - Clock Frequency
4973  Returns:
4974  None.
4975  Example:
4976  <code>
4977 #define MY_USART_INSTANCE USART_ID_1
4978  uint32_t baudRateValue ;
4979  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
4980  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
4981  </code>
4982  Remarks:
4983  Setting a new baud rate value causes the baud rate timer to reset.
4984  This ensures that the baud rate timer does not have to overflow before
4985  outputting the new baud rate.
4986 
4987  If the system clock is changed during an active receive operation, a
4988  receiver error or data loss may result. To avoid this issue verify that
4989  no receptions are in progress before changing the system clock.
4990 
4991  This feature may not be available on all devices. Please refer to the
4992  specific device data sheet to determine availability or use
4993  PLIB_USART_ExistsBaudRate in your application to determine whether
4994  this feature is available.
4995 */
4996 
4997 void
4999  USART_MODULE_ID index ,
5000  uint32_t clockFrequency ,
5001  uint32_t baudRate ) ;
5002 //******************************************************************************
5003 /* Function:
5004  void PLIB_USART_BaudRateHighSet ( USART_MODULE_ID index,
5005  uint32_t clockFrequency, uint32_t baudRate );
5006  Summary:
5007  Sets the baud rate to the desired value.
5008  Description:
5009  This function sets the baud rate to the desired value.
5010  Precondition:
5011  None.
5012  Parameters:
5013  index - Identifier for the device instance to be configured
5014  baudRate - Baud Rate Value, it is the baud rate value
5015  clockFrequency - Clock Frequency
5016  Returns:
5017  None.
5018  Example:
5019  <code>
5020 #define MY_USART_INSTANCE USART_ID_1
5021  uint32_t baudRateValue ;
5022  PLIB_USART_BaudRateHighSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5023  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5024  </code>
5025  Remarks:
5026  Setting a new baud rate value causes the baud rate timer to reset.
5027  This ensures that the baud rate timer does not have to overflow before
5028  outputting the new baud rate.
5029 
5030  If the system clock is changed during an active receive operation, a
5031  receiver error or data loss may result. To avoid this issue verify that
5032  no receptions are in progress before changing the system clock.
5033 
5034  This feature may not be available on all devices. Please refer to the
5035  specific device data sheet to determine availability or use
5036  PLIB_USART_ExistsBaudRateHigh in your application to determine whether
5037  this feature is available.
5038 */
5039 
5040 void
5042  USART_MODULE_ID index ,
5043  uint32_t clockFrequency ,
5044  uint32_t baudRate ) ;
5045 //******************************************************************************
5046 /* Function:
5047  uint32_t PLIB_USART_BaudRateGet ( USART_MODULE_ID index,
5048  int32_t clockFrequency );
5049  Summary:
5050  Gets the baud rate current in use.
5051  Description:
5052  This function gets the baud rate that is currently in use. The clock frequency
5053  needs to be passed to the function.
5054  Conditions:
5055  None.
5056  Input:
5057  index - Identifier for the device instance to be configured
5058  clockFrequency - Clock Frequency
5059  Returns:
5060  - BaudRate - Baud rate value
5061  Example:
5062  <code>
5063 #define MY_USART_INSTANCE USART_ID_1
5064  uint32_t baudRate ;
5065  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5066  baudRate = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5067  </code>
5068  Remarks:
5069  This feature may not be available on all devices. Please refer to the
5070  specific device data sheet to determine availability or use
5071  PLIB_USART_ExistsBaudRate in your application to determine whether
5072  this feature is available.
5073 */
5074 
5075 uint32_t
5077  USART_MODULE_ID index ,
5078  int32_t clockFrequency ) ;
5079 //******************************************************************************
5080 /* Function:
5081  void PLIB_USART_AddressSet
5082  (
5083  USART_MODULE_ID index,
5084  uint8_t address
5085  )
5086  Summary:
5087  Sets the address for the Address Detect mode.
5088  Description:
5089  This function sets the address for the Address Detect mode.
5090  This operation is atomic.
5091  Precondition:
5092  None.
5093  Parameters:
5094  index - Identifier for the device instance to be configured
5095  address - Address
5096  Returns:
5097  None.
5098  Example:
5099  <code>
5100 #define MY_USART_INSTANCE USART_ID_1
5101  uint8_t address = 0x02;
5102  PLIB_USART_AddressSet (MY_USART_INSTANCE, address);
5103  </code>
5104  Remarks:
5105  This feature may not be available on all devices. Please refer to the
5106  specific device data sheet to determine availability or use
5107  PLIB_USART_ExistsReceiverAddress in your application to determine
5108  whether this feature is available.
5109 */
5110 
5111 void
5113  USART_MODULE_ID index ,
5114  uint8_t address ) ;
5115 //******************************************************************************
5116 /* Function:
5117  uint8_t PLIB_USART_AddressGet
5118  (
5119  USART_MODULE_ID index
5120  )
5121  Summary:
5122  Gets the address for the Address Detect mode.
5123  Description:
5124  This function returns the address value being used for the Address
5125  Detect mode.
5126  This operation is atomic.
5127  Precondition:
5128  None.
5129  Parameters:
5130  index - Identifier for the device instance
5131  Returns:
5132  - address - The address being used
5133  Example:
5134  <code>
5135 #define MY_USART_INSTANCE USART_ID_1
5136  uint8_t address = 0;
5137  address = PLIB_USART_AddressGet (MY_USART_INSTANCE);
5138  </code>
5139  Remarks:
5140  This feature may not be available on all devices. Please refer to the
5141  specific device data sheet to determine availability or use
5142  PLIB_USART_ExistsReceiverAddress in your application to determine
5143  whether this feature is available.
5144 */
5145 
5146 uint8_t
5148  USART_MODULE_ID index ) ;
5149 //******************************************************************************
5150 /* Function:
5151  void PLIB_USART_AddressMaskSet
5152  (
5153  USART_MODULE_ID index,
5154  uint8_t mask
5155  )
5156  Summary:
5157  Sets the address mask for the Address Detect mode.
5158  Description:
5159  This function sets the address mask for the Address Detect mode.
5160  This operation is atomic.
5161  Precondition:
5162  None.
5163  Parameters:
5164  index - Identifier for the device instance to be configured
5165  mask - Address match mask bits
5166  Returns:
5167  None.
5168  Example:
5169  <code>
5170 #define MY_USART_INSTANCE USART_ID_1
5171  uint8_t mask = 0x0F;
5172  PLIB_USART_AddressMaskSet (MY_USART_INSTANCE, mask);
5173  </code>
5174  Remarks:
5175  This feature may not be available on all devices. Please refer to the
5176  specific device data sheet to determine availability or use
5177  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5178  whether this feature is available.
5179 */
5180 
5181 void
5183  USART_MODULE_ID index ,
5184  uint8_t mask ) ;
5185 //******************************************************************************
5186 /* Function:
5187  uint8_t PLIB_USART_AddressMaskGet
5188  (
5189  USART_MODULE_ID index
5190  )
5191  Summary:
5192  Gets the address mask for the Address Detect mode.
5193  Description:
5194  This function returns the address mask value being used for the Address
5195  Detect mode.
5196  This operation is atomic.
5197  Precondition:
5198  None.
5199  Parameters:
5200  index - Identifier for the device instance to be configured
5201  Returns:
5202  - mask - Address mask being used
5203  Example:
5204  <code>
5205 #define MY_USART_INSTANCE USART_ID_1
5206  uint8_t mask = 0;
5207  mask = PLIB_USART_AddressMaskGet (MY_USART_INSTANCE);
5208  </code>
5209  Remarks:
5210  This feature may not be available on all devices. Please refer to the
5211  specific device data sheet to determine availability or use
5212  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5213  whether this feature is available.
5214 */
5215 
5216 uint8_t
5218  USART_MODULE_ID index ) ;
5219 //******************************************************************************
5220 /* Function:
5221  void PLIB_USART_ReceiverAddressDetectEnable ( USART_MODULE_ID index )
5222  Summary:
5223  Enables the Address Detect mode.
5224  Description:
5225  This function enables the Address Detect mode. If it is enabled, and the
5226  device is addressed, disable the Address Detect mode to continue receiving
5227  bytes.
5228  This operation is atomic.
5229  Precondition:
5230  None.
5231  Parameters:
5232  index - Identifier for the device instance to be configured
5233  Returns:
5234  None.
5235  Example:
5236  <code>
5237 #define MY_USART_INSTANCE USART_ID_1
5238  PLIB_USART_ReceiverAddressDetectEnable(MY_USART_INSTANCE);
5239  </code>
5240  Remarks:
5241  If 9 data bits are not selected, this bit has no effect.
5242  This feature may not be available on all devices. Please refer to the
5243  specific device data sheet to determine availability or use
5244  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5245  this feature is available.
5246 */
5247 
5248 void
5250  USART_MODULE_ID index ) ;
5251 //******************************************************************************
5252 /* Function:
5253  void PLIB_USART_ReceiverAddressDetectDisable ( USART_MODULE_ID index )
5254  Summary:
5255  Enables the Address Detect mode.
5256  Description:
5257  This function disables the Address Detect mode. If it is enabled, and the
5258  device is addressed, disable the Address Detect mode to continue receiving
5259  bytes.
5260  This operation is atomic.
5261  Precondition:
5262  None.
5263  Parameters:
5264  index - Identifier for the device instance to be configured
5265  Returns:
5266  None.
5267  Example:
5268  <code>
5269 #define MY_USART_INSTANCE USART_ID_1
5270  PLIB_USART_ReceiverAddressDetectDisable(MY_USART_INSTANCE);
5271  </code>
5272  Remarks:
5273  All bytes are received, and the 9th bit can be used as the parity bit.
5274  By default, the address detect is disabled.
5275 
5276  This feature may not be available on all devices. Please refer to the
5277  specific device data sheet to determine availability or use
5278  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5279  this feature is available.
5280 */
5281 
5282 void
5284  USART_MODULE_ID index ) ;
5285 //******************************************************************************
5286 /* Function:
5287  bool PLIB_USART_BaudRateAutoDetectIsComplete ( USART_MODULE_ID index )
5288  Summary:
5289  Gets the state of the automatic baud detection.
5290  Description:
5291  This function gets the state of the automatic baud detection and returns a '0'
5292  if the baud rate auto detection is complete.
5293  This operation is atomic.
5294  Precondition:
5295  None.
5296  Parameters:
5297  index - Identifier for the device instance to be configured
5298  Returns:
5299  - true - Baud rate detection is not complete
5300  - false - Baud rate detection is complete
5301  Example:
5302  <code>
5303 #define MY_USART_INSTANCE USART_ID_1
5304  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5305  // Wait until the baud rate is detected.
5306  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5307  </code>
5308  Remarks:
5309  This feature may not be available on all devices. Please refer to the
5310  specific device data sheet to determine availability or use
5311  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5312  this feature is available.
5313 */
5314 
5315 bool
5317  USART_MODULE_ID index ) ;
5318 //******************************************************************************
5319 /* Function:
5320  void PLIB_USART_BaudRateAutoDetectEnable ( USART_MODULE_ID index )
5321  Summary:
5322  Enables baud rate measurement on the next character, which requires reception
5323  of the Sync character.
5324  Description:
5325  This function enables the baud rate measurement on the next character,
5326  which requires reception of the Sync character.
5327  This operation is atomic.
5328  Precondition:
5329  None.
5330  Parameters:
5331  index - Identifier for the device instance to be configured
5332  Returns:
5333  None.
5334  Example:
5335  <code>
5336 #define MY_USART_INSTANCE USART_ID_1
5337  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5338  // Wait until the baud rate is detected.
5339  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5340  </code>
5341  Remarks:
5342  This feature may not be available on all devices. Please refer to the
5343  specific device data sheet to determine availability or use
5344  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5345  this feature is available.
5346 */
5347 
5348 void
5350  USART_MODULE_ID index ) ;
5351 //******************************************************************************
5352 /* Function:
5353  void PLIB_USART_TransmitterByteSend ( USART_MODULE_ID index, int8_t data )
5354  Summary:
5355  Data to be transmitted in the Byte mode.
5356  Description:
5357  The data is transmitted in the Byte mode for the specified USART module.
5358  This operation is atomic.
5359  Precondition:
5360  None.
5361  Parameters:
5362  index - Identifier for the device instance to be configured
5363  data - Data to be transmitted.
5364  Returns:
5365  None.
5366  Example:
5367  <code>
5368 #define MY_USART_INSTANCE USART_ID_1
5369  uint8_t data = 'a';
5370  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5371  {
5372  PLIB_USART_TransmitterByteSend(MY_USART_INSTANCE, data);
5373  }
5374  </code>
5375  Remarks:
5376  This feature may not be available on all devices. Please refer to the
5377  specific device data sheet to determine availability or use
5378  PLIB_USART_ExistsTransmitter in your application to determine whether
5379  this feature is available.
5380 */
5381 
5382 void
5384  USART_MODULE_ID index ,
5385  int8_t data ) ;
5386 //******************************************************************************
5387 /* Function:
5388  int8_t PLIB_USART_ReceiverByteReceive ( USART_MODULE_ID index )
5389  Summary:
5390  Data to be received in the Byte mode.
5391  Description:
5392  The data to be received in Byte mode from the specified USART module.
5393  This operation is atomic.
5394  Call the functions PLIB_USART_ReceiverFramingErrorHasOccurred,
5395  PLIB_USART_ReceiverParityErrorHasOccurred and
5396  PLIB_USART_ReceiverOverrunHasOccurred to get any error that occurred.
5397  Precondition:
5398  None.
5399  Parameters:
5400  index - Identifier for the device instance to be configured
5401  Returns:
5402  - data - Data to be received
5403  Example:
5404  <code>
5405 #define MY_USART_INSTANCE USART_ID_1
5406  bool isError;
5407  uint8_t mydata;
5408  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5409  {
5410  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5411  }
5412  isError = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE) |
5413  PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE) |
5414  PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE);
5415  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5416  {
5417  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5418  }
5419  </code>
5420  Remarks:
5421  This feature may not be available on all devices. Please refer to the
5422  specific device data sheet to determine availability or use
5423  PLIB_USART_ExistsReceiver in your application to determine whether
5424  this feature is available.
5425 */
5426 
5427 int8_t
5429  USART_MODULE_ID index ) ;
5430 //******************************************************************************
5431 /* Function:
5432  int16_t PLIB_USART_Receiver9BitsReceive ( USART_MODULE_ID index )
5433  Summary:
5434  Data to be received in the byte mode with the 9th bit.
5435  Description:
5436  The data to be received in Byte mode from the specified USART module.
5437  with the 9th bit.
5438  This operation is atomic.
5439  Precondition:
5440  None.
5441  Parameters:
5442  index - Identifier for the device instance to be configured
5443  Returns:
5444  - data - Data to be received
5445  Example:
5446  <code>
5447 #define MY_USART_INSTANCE USART_ID_1
5448  uint16_t mydata;
5449  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5450  {
5451  mydata = PLIB_USART_Receiver9BitsReceive (MY_USART_INSTANCE);
5452  }
5453  </code>
5454  Remarks:
5455  This feature may not be available on all devices. Please refer to the
5456  specific device data sheet to determine availability or use
5457  PLIB_USART_ExistsReceiver9Bits in your application to determine
5458  whether this feature is available.
5459 */
5460 
5461 int16_t
5463  USART_MODULE_ID index ) ;
5464 //******************************************************************************
5465 /* Function:
5466  bool PLIB_USART_ReceiverAddressIsReceived ( USART_MODULE_ID index )
5467  Summary:
5468  Checks and return if the data received is an address.
5469  Description:
5470  Checks and return if the data received is an address. The address has
5471  the 9th bit set. If data received has the 9th bit set, the function returns true;
5472  otherwise, the function returns false.
5473  This operation is atomic.
5474  Precondition:
5475  The USART module should be configured to use the 9 data bits.
5476  Parameters:
5477  index - Identifier for the device instance to be configured
5478  Returns:
5479  - true - if the data received has the 9th bit set
5480  - false - if the address received has the 9th bit cleared
5481  Example:
5482  <code>
5483 #define MY_USART_INSTANCE USART_ID_1
5484  int8_t address;
5485  if(PLIB_USART_ReceiverAddressIsReceived(MY_USART_INSTANCE))
5486  {
5487  address = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5488  }
5489  </code>
5490  Remarks:
5491  This feature may not be available on all devices. Please refer to the
5492  specific device data sheet to determine availability or use
5493  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5494  this feature is available.
5495 */
5496 
5497 bool
5499  USART_MODULE_ID index ) ;
5500 //******************************************************************************
5501 /* Function:
5502  void PLIB_USART_Transmitter9BitsSend ( USART_MODULE_ID index,
5503  int8_t data, bool 9thBit )
5504  Summary:
5505  Data to be transmitted in the byte mode with the 9th bit.
5506  Description:
5507  The data is transmitted in the byte mode for the specified USART module,
5508  with 9th bit.
5509  This operation is atomic.
5510  Precondition:
5511  The USART module should be configured to use the 9 data bits.
5512  Parameters:
5513  index - Identifier for the device instance to be configured
5514  data - Data to be transmitted.
5515  9thBit - 9th bit of the data to be transmitted.
5516  Returns:
5517  None.
5518  Example:
5519  <code>
5520 #define MY_USART_INSTANCE USART_ID_1
5521  uint8_t data = 'a';
5522  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5523  {
5524  PLIB_USART_Transmitter9BitsSend(MY_USART_INSTANCE, data, false);
5525  }
5526  </code>
5527  Remarks:
5528  This feature may not be available on all devices. Please refer to the
5529  specific device data sheet to determine availability or use
5530  PLIB_USART_ExistsTransmitter9BitsSend in your application to determine whether
5531  this feature is available.
5532 */
5533 
5534 void
5536  USART_MODULE_ID index ,
5537  int8_t data ,
5538  bool Bit9th ) ;
5539 //******************************************************************************
5540 /* Function:
5541  void PLIB_USART_TransmitterBreakSend ( USART_MODULE_ID index )
5542  Summary:
5543  Transmits the break character.
5544  Description:
5545  This function transmits the break character.
5546  This operation is atomic.
5547  Precondition:
5548  The application should wait for the transmitter to be idle, before calling
5549  this function.
5550  Parameters:
5551  index - Identifier for the device instance to be configured
5552  Returns:
5553  None.
5554  Example:
5555  <code>
5556 #define MY_USART_INSTANCE USART_ID_1
5557  // Wait for the Transmit buffer to be empty.
5558  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5559  // Transmit the break character.
5560  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5561  // wait for the break transmission to complete
5562  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
5563  </code>
5564  Remarks:
5565  After the break has been transmitted, the application can start
5566  transmitting next bytes.
5567 
5568  This feature may not be available on all devices. Please refer to the
5569  specific device data sheet to determine availability or use
5570  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
5571  this feature is available.
5572 */
5573 
5574 void
5576  USART_MODULE_ID index ) ;
5577 //******************************************************************************
5578 /* Function:
5579  bool PLIB_USART_TransmitterBreakSendIsComplete ( USART_MODULE_ID index )
5580  Summary:
5581  Returns the status of the break transmission
5582  Description:
5583  The function returns the status of the break transmission.
5584  This operation is atomic.
5585  Precondition:
5586  None.
5587  Parameters:
5588  index - Identifier for the device instance to be configured
5589  Returns:
5590  - true - Transmit break on the next transmission
5591  - false - Break transmission completed or not started
5592  Example:
5593  <code>
5594 #define MY_USART_INSTANCE USART_ID_1
5595  // Wait for the Transmit buffer to be empty.
5596  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5597  // Transmit the break character.
5598  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5599  // wait for the break transmission to complete
5600  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
5601  </code>
5602  Remarks:
5603  After the break has been transmitted, the application can start
5604  transmitting next bytes.
5605 
5606  This feature may not be available on all devices. Please refer to the
5607  specific device data sheet to determine availability or use
5608  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
5609  this feature is available.
5610 */
5611 
5612 bool
5614  USART_MODULE_ID index ) ;
5615 //******************************************************************************
5616 /* Function:
5617  bool PLIB_USART_ReceiverDataIsAvailable ( USART_MODULE_ID index )
5618  Summary:
5619  Identifies if the receive data is available for the specified USART module.
5620  Description:
5621  This function identifies if the receive data is available for the specified
5622  USART module.
5623  This operation is atomic.
5624  Precondition:
5625  None.
5626  Parameters:
5627  index - Identifier for the device instance to be configured
5628  Returns:
5629  - true - The data is available
5630  - false - The data is not available
5631  Example:
5632  <code>
5633 #define MY_USART_INSTANCE USART_ID_1
5634  int8_t mydata;
5635  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5636  {
5637  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5638  }
5639  </code>
5640  Remarks:
5641  This feature may not be available on all devices. Please refer to the
5642  specific device data sheet to determine availability or use
5643  PLIB_USART_ExistsReceiverDataAvailableStatus in your application to determine
5644  whether this feature is available.
5645 */
5646 
5647 bool
5649  USART_MODULE_ID index ) ;
5650 //******************************************************************************
5651 /* Function:
5652  void PLIB_USART_ReceiverOverrunErrorClear ( USART_MODULE_ID index )
5653  Summary:
5654  Clears a USART vverrun error.
5655  Description:
5656  This function clears an overrun error. Clearing the error, resets the receive buffer.
5657  This operation is atomic.
5658  Precondition:
5659  None.
5660  Parameters:
5661  index - Identifier for the device instance to be configured
5662  Returns:
5663  None.
5664  Example:
5665  <code>
5666 #define MY_USART_INSTANCE USART_ID_1
5667  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5668  {
5669  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5670  }
5671  </code>
5672  Remarks:
5673  WARNING: Calling this API will clear all of the previously received data.
5674 
5675  This feature may not be available on all devices. Please refer to the
5676  specific device data sheet to determine availability or use
5677  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
5678  whether this feature is available.
5679 */
5680 
5681 void
5683  USART_MODULE_ID index ) ;
5684 //******************************************************************************
5685 /* Function:
5686  bool PLIB_USART_TransmitterBufferIsFull ( USART_MODULE_ID index )
5687  Summary:
5688  Gets the transmit buffer full status.
5689  Description:
5690  This function gets the transmit status of the specified USART module.
5691  This operation is atomic.
5692  Precondition:
5693  None.
5694  Parameters:
5695  index - Identifier for the device instance to be configured
5696  Returns:
5697  - true - The transmit buffer is full
5698  - false - The transmit buffer is not full, at least one more
5699  character can be written
5700  Example:
5701  <code>
5702 #define MY_USART_INSTANCE USART_ID_1
5703  // Wait for the Transmit buffer to be empty.
5704  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5705  // Transmit the break character.
5706  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5707  </code>
5708  Remarks:
5709  This feature may not be available on all devices. Please refer to the
5710  specific device data sheet to determine availability or use
5711  PLIB_USART_ExistsTransmitterBufferFullStatus in your application to determine
5712  whether this feature is available.
5713 */
5714 
5715 bool
5717  USART_MODULE_ID index ) ;
5718 //******************************************************************************
5719 /* Function:
5720  bool PLIB_USART_TransmitterIsEmpty ( USART_MODULE_ID index )
5721  Summary:
5722  Gets the transmit shift register empty status.
5723  Description:
5724  This function gets the transmit shift register empty status.
5725  This operation is atomic.
5726  Precondition:
5727  None.
5728  Parameters:
5729  index - Identifier for the device instance to be configured
5730  Returns:
5731  - true - The transmit shift register is empty
5732  - false - The transmit shift register is not empty
5733  Example:
5734  <code>
5735 #define MY_USART_INSTANCE USART_ID_1
5736  // Wait for the Transmit buffer to be empty.
5737  while(!PLIB_USART_TransmitterIsEmpty(MY_USART_INSTANCE));
5738  // Transmit the break character.
5739  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5740  </code>
5741  Remarks:
5742  This feature may not be available on all devices. Please refer to the
5743  specific device data sheet to determine availability or use
5744  PLIB_USART_ExistsTransmitterEmptyStatus in your application to determine
5745  whether this feature is available.
5746 */
5747 
5748 bool
5750  USART_MODULE_ID index ) ;
5751 //******************************************************************************
5752 /* Function:
5753  bool PLIB_USART_ReceiverFramingErrorHasOccurred ( USART_MODULE_ID index )
5754  Summary:
5755  Gets the framing error status.
5756  Description:
5757  This function gets the framing error status.
5758  This operation is atomic.
5759  Precondition:
5760  None.
5761  Parameters:
5762  index - Identifier for the device instance to be configured
5763  Returns:
5764  - true - The framing error was detected on the current character
5765  - false - The framing error was not detected on the current
5766  character
5767  Example:
5768  <code>
5769 #define MY_USART_INSTANCE USART_ID_1
5770  status = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE);
5771  </code>
5772  Remarks:
5773  Reading the error clears the error.
5774  This feature may not be available on all devices. Please refer to the
5775  specific device data sheet to determine availability or use
5776  PLIB_USART_ExistsReceiverFramingErrorStatus in your application to determine
5777  whether this feature is available.
5778 */
5779 
5780 bool
5782  USART_MODULE_ID index ) ;
5783 //******************************************************************************
5784 /* Function:
5785  bool PLIB_USART_ReceiverParityErrorHasOccurred ( USART_MODULE_ID index )
5786  Summary:
5787  Gets the parity error status.
5788  Description:
5789  This function gets the parity error status.
5790  This operation is atomic.
5791  Precondition:
5792  None.
5793  Parameters:
5794  index - Identifier for the device instance to be configured
5795  Returns:
5796  - true - The parity error was detected on the current character
5797  - false - The parity error was not detected on the current character
5798  Example:
5799  <code>
5800 #define MY_USART_INSTANCE USART_ID_1
5801  status = PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE);
5802  </code>
5803  Remarks:
5804  Reading the error clears the error.
5805  A Parity error is irrelevant in case of 9-bit mode.
5806  This feature may not be available on all devices. Please refer to the
5807  specific device data sheet to determine availability or use
5808  PLIB_USART_ExistsReceiverParityErrorStatus in your application to determine
5809  whether this feature is available.
5810 */
5811 
5812 bool
5814  USART_MODULE_ID index ) ;
5815 //******************************************************************************
5816 /* Function:
5817  bool PLIB_USART_ReceiverOverrunHasOccurred ( USART_MODULE_ID index )
5818  Summary:
5819  Identifies if there was a receiver overrun error.
5820  Description:
5821  This function identifies if there was a receiver overrun error.
5822  This operation is atomic.
5823  Precondition:
5824  None.
5825  Parameters:
5826  index - Identifier for the device instance to be configured
5827  Returns:
5828  - true - The receive buffer has overflowed
5829  - false - The receive buffer has not overflowed
5830  Example:
5831  <code>
5832 #define MY_USART_INSTANCE USART_ID_1
5833  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5834  {
5835  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5836  }
5837  </code>
5838  Remarks:
5839  This feature may not be available on all devices. Please refer to the
5840  specific device data sheet to determine availability or use
5841  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
5842  whether this feature is available.
5843 */
5844 
5845 bool
5847  USART_MODULE_ID index ) ;
5848 //******************************************************************************
5849 /* Function:
5850  bool PLIB_USART_ReceiverIsIdle ( USART_MODULE_ID index )
5851  Summary:
5852  Identifies if the receiver is idle.
5853  Description:
5854  This function identifies if the receiver is idle.
5855  This operation is atomic.
5856  Precondition:
5857  None.
5858  Parameters:
5859  index - Identifier for the device instance to be configured
5860  Returns:
5861  - true - The receive buffer is idle
5862  - false - The receive buffer is not idle
5863  Example:
5864  <code>
5865 #define MY_USART_INSTANCE USART_ID_1
5866  int8_t mydata;
5867  if(PLIB_USART_ReceiverIsIdle(MY_USART_INSTANCE))
5868  {
5869  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5870  }
5871  </code>
5872  Remarks:
5873  This feature may not be available on all devices. Please refer to the
5874  specific device data sheet to determine availability or use
5875  PLIB_USART_ExistsReceiverIdleStatus in your application to determine
5876  whether this feature is available.
5877 */
5878 
5879 bool
5881  USART_MODULE_ID index ) ;
5882 //******************************************************************************
5883 /* Function:
5884  void PLIB_USART_ReceiverEnable ( USART_MODULE_ID index )
5885  Summary:
5886  Enables the USART receiver.
5887  Description:
5888  This function enables the USART receiver.
5889  This operation is atomic.
5890  Precondition:
5891  None.
5892  Parameters:
5893  index - Identifier for the device instance to be configured
5894  Returns:
5895  None.
5896  Example:
5897  <code>
5898 #define MY_USART_INSTANCE USART_ID_1
5899  PLIB_USART_ReceiverEnable(MY_USART_INSTANCE);
5900  </code>
5901  Remarks:
5902  This feature may not be available on all devices. Please refer to the
5903  specific device data sheet to determine availability or use
5904  PLIB_USART_ExistsReceiverEnable in your application to determine
5905  whether this feature is available.
5906 */
5907 
5908 void
5910  USART_MODULE_ID index ) ;
5911 //******************************************************************************
5912 /* Function:
5913  void PLIB_USART_ReceiverDisable ( USART_MODULE_ID index )
5914  Summary:
5915  Disables the USART receiver.
5916  Description:
5917  This function disables the USART receiver.
5918  This operation is atomic.
5919  Precondition:
5920  None.
5921  Parameters:
5922  index - Identifier for the device instance to be configured
5923  Returns:
5924  None.
5925  Example:
5926  <code>
5927 #define MY_USART_INSTANCE USART_ID_1
5928  PLIB_USART_ReceiverDisable(MY_USART_INSTANCE);
5929  </code>
5930  Remarks:
5931  This feature may not be available on all devices. Please refer to the
5932  specific device data sheet to determine availability or use
5933  PLIB_USART_ExistsReceiverEnable in your application to determine
5934  whether this feature is available.
5935 */
5936 
5937 void
5939  USART_MODULE_ID index ) ;
5940 //******************************************************************************
5941 /* Function:
5942  void PLIB_USART_TransmitterIdleIsLowEnable ( USART_MODULE_ID index )
5943  Summary:
5944  Enables the Transmit Idle Low state.
5945  Description:
5946  This function enables the Transmit Idle Low state. In the USART Synchronous
5947  mode, this function configures that the TX polarity, the idle state is low.
5948  When IrDA is enabled, this function sets that IrDA encoded Transmit Idle
5949  state to a '1'.
5950  This operation is atomic.
5951  Precondition:
5952  None.
5953  Parameters:
5954  index - Identifier for the device instance to be configured
5955  Returns:
5956  None.
5957  Example:
5958  <code>
5959 #define MY_USART_INSTANCE USART_ID_1
5960  PLIB_USART_TransmitterIdleIsLowEnable(MY_USART_INSTANCE);
5961  </code>
5962  Remarks:
5963  This feature may not be available on all devices. Please refer to the
5964  specific device data sheet to determine availability or use
5965  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
5966  whether this feature is available.
5967 */
5968 
5969 void
5971  USART_MODULE_ID index ) ;
5972 //******************************************************************************
5973 /* Function:
5974  void PLIB_USART_TransmitterIdleIsLowDisable ( USART_MODULE_ID index )
5975  Summary:
5976  Disables the Transmit Idle Low state.
5977  Description:
5978  This function disables the Transmit Idle Low state. In USART Synchronous mode,
5979  this function configures that the TX polarity the idle state is high.
5980  When IrDA is enabled, this function sets the IrDA encoded Transmit Idle
5981  state to a '0'.
5982  This operation is atomic.
5983  Precondition:
5984  None.
5985  Parameters:
5986  index - Identifier for the device instance to be configured
5987  Returns:
5988  None.
5989  Example:
5990  <code>
5991 #define MY_USART_INSTANCE USART_ID_1
5992  PLIB_USART_TransmitterIdleIsLowDisable(MY_USART_INSTANCE);
5993  </code>
5994  Remarks:
5995  This feature may not be available on all devices. Please refer to the
5996  specific device data sheet to determine availability or use
5997  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
5998  whether this feature is available.
5999 */
6000 
6001 void
6003  USART_MODULE_ID index ) ;
6004 //******************************************************************************
6005 /* Function:
6006  void PLIB_USART_ReceiverIdleStateLowEnable ( USART_MODULE_ID index )
6007  Summary:
6008  Enables receive polarity inversion.
6009  Description:
6010  This function enables receive polarity inversion. In the USART Synchronous mode,
6011  this function configures that the data is inverted.
6012  This operation is atomic.
6013  Precondition:
6014  None.
6015  Parameters:
6016  index - Identifier for the device instance to be configured
6017  Returns:
6018  None.
6019  Example:
6020  <code>
6021 #define MY_USART_INSTANCE USART_ID_1
6022  PLIB_USART_ReceiverIdleStateLowEnable(MY_USART_INSTANCE);
6023  </code>
6024  Remarks:
6025  This feature may not be available on all devices. Please refer to the
6026  specific device data sheet to determine availability or use
6027  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6028  whether this feature is available.
6029 */
6030 
6031 void
6033  USART_MODULE_ID index ) ;
6034 //******************************************************************************
6035 /* Function:
6036  void PLIB_USART_ReceiverIdleStateLowDisable ( USART_MODULE_ID index );
6037  Summary:
6038  Disables receive polarity inversion.
6039  This operation is atomic.
6040  Description:
6041  This function disables receive polarity inversion. In the USART Synchronous
6042  mode, this function configures that the data is not inverted.
6043  Precondition:
6044  None.
6045  Parameters:
6046  index - Identifier for the device instance to be configured
6047  Returns:
6048  None.
6049  Example:
6050  <code>
6051 #define MY_USART_INSTANCE USART_ID_1
6052  PLIB_USART_ReceiverIdleStateLowDisable(MY_USART_INSTANCE);
6053  </code>
6054  Remarks:
6055  This feature may not be available on all devices. Please refer to the
6056  specific device data sheet to determine availability or use
6057  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6058  whether this feature is available.
6059 */
6060 
6061 void
6063  USART_MODULE_ID index ) ;
6064 //******************************************************************************
6065 /* Function:
6066  void PLIB_USART_BaudRateHighEnable ( USART_MODULE_ID index )
6067  Summary:
6068  Enables high baud rate selection.
6069  Description:
6070  This function enables high baud rate selection.
6071  This operation is atomic.
6072  Precondition:
6073  None.
6074  Parameters:
6075  index - Identifier for the device instance to be configured
6076  Returns:
6077  None.
6078  Example:
6079  <code>
6080 #define MY_USART_INSTANCE USART_ID_1
6081  PLIB_USART_BaudRateHighEnable(MY_USART_INSTANCE);
6082  </code>
6083  Remarks:
6084  This feature may not be available on all devices. Please refer to the
6085  specific device data sheet to determine availability or use
6086  PLIB_USART_ExistsBaudRateHigh in your application to determine
6087  whether this feature is available.
6088 */
6089 
6090 void
6092  USART_MODULE_ID index ) ;
6093 //******************************************************************************
6094 /* Function:
6095  void PLIB_USART_BaudRateHighDisable ( USART_MODULE_ID index )
6096  Summary:
6097  Disables the high baud rate selection.
6098  Description:
6099  This function disables the high baud rate selection.
6100  This operation is atomic.
6101  Precondition:
6102  None.
6103  Parameters:
6104  index - Identifier for the device instance to be configured
6105  Returns:
6106  None.
6107  Example:
6108  <code>
6109 #define MY_USART_INSTANCE USART_ID_1
6110  PLIB_USART_BaudRateHighDisable(MY_USART_INSTANCE);
6111  </code>
6112  Remarks:
6113  This feature may not be available on all devices. Please refer to the
6114  specific device data sheet to determine availability or use
6115  PLIB_USART_ExistsBaudRateHigh in your application to determine
6116  whether this feature is available.
6117 */
6118 
6119 void
6121  USART_MODULE_ID index ) ;
6122 //******************************************************************************
6123 /* Function:
6124  void PLIB_USART_TransmitterInterruptModeSelect( USART_MODULE_ID index,
6125  USART_TRANSMIT_INTR_MODE interruptMode )
6126  Summary:
6127  Sets the USART transmitter interrupt mode.
6128  Description:
6129  This function sets the condition in which the USART module should generate
6130  an interrupt.
6131  This operation is atomic.
6132  Precondition:
6133  None.
6134  Parameters:
6135  index - Identifier for the device instance to be configured
6136  interruptMode - Interrupt mode; for possible configurations, refer to
6137  USART_TRANSMIT_INTR_MODE
6138  Returns:
6139  None.
6140  Example:
6141  <code>
6142 #define MY_USART_INSTANCE USART_ID_1
6143  PLIB_USART_TransmitterInterruptModeSelect(MY_USART_INSTANCE,
6144  USART_TRANSMIT_FIFO_EMPTY );
6145  </code>
6146  Remarks:
6147  This feature may not be available on all devices. Please refer to the
6148  specific device data sheet to determine availability or use
6149  PLIB_USART_ExistsTransmitterInterruptMode in your application to determine
6150  whether this feature is available.
6151 */
6152 
6153 void
6155  USART_MODULE_ID index ,
6156  USART_TRANSMIT_INTR_MODE fifolevel ) ;
6157 //******************************************************************************
6158 /* Function:
6159  void PLIB_USART_ReceiverInterruptModeSelect( USART_MODULE_ID index,
6160  USART_RECEIVE_INTR_MODE interruptMode )
6161  Summary:
6162  Sets the USART receiver FIFO level.
6163  Description:
6164  This function sets the USART receiver FIFO level.
6165  This operation is atomic.
6166  Precondition:
6167  None.
6168  Parameters:
6169  index - Identifier for the device instance to be configured
6170  fifolevel - For possible configurations, refer to USART_RECEIVE_INTR_MODE
6171  Returns:
6172  None.
6173  Example:
6174  <code>
6175 #define MY_USART_INSTANCE USART_ID_1
6176  PLIB_USART_ReceiverInterruptModeSelect(MY_USART_INSTANCE,
6177  USART_RECEIVE_FIFO_ONE_CHAR );
6178  </code>
6179  Remarks:
6180  This feature may not be available on all devices. Please refer to the
6181  specific device data sheet to determine availability or use
6182  PLIB_USART_ExistsReceiverInterruptMode in your application to determine
6183  whether this feature is available.
6184 */
6185 
6186 void
6188  USART_MODULE_ID index ,
6189  USART_RECEIVE_INTR_MODE interruptMode ) ;
6190 //******************************************************************************
6191 /* Function:
6192  void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index,
6193  USART_LINECONTROL_MODE dataFlowConfig)
6194  Summary:
6195  Sets the data flow configuration.
6196  Description:
6197  This function sets the USART data flow configuration based on the mask
6198  provided and the specified baud rate.
6199  Precondition:
6200  None.
6201  Parameters:
6202  index - Identifier for the device instance to be configured
6203  mode - For possible data flow configurations, refer to
6204  USART_LINECONTROL_MODE
6205  Returns:
6206  None.
6207  Example:
6208  <code>
6209 #define MY_USART_INSTANCE USART_ID_1
6210  PLIB_USART_LineControlModeSelect(MY_USART_INSTANCE, \
6211  USART_8N1);
6212  </code>
6213  Remarks:
6214  This feature may not be available on all devices. Please refer to the
6215  specific device data sheet to determine availability or use
6216  PLIB_USART_ExistsLineControlMode in your application to determine
6217  whether this feature is available.
6218 */
6219 
6220 void
6222  USART_MODULE_ID index ,
6223  USART_LINECONTROL_MODE dataFlowConfig ) ;
6224 //******************************************************************************
6225 /* Function:
6226  void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index,
6227  USART_HANDSHAKE_MODE handshakeConfig)
6228  Summary:
6229  Sets the data flow configuration.
6230  Description:
6231  This function sets the USART data flow configuration based on the mask
6232  provided and the specified baud rate.
6233  Precondition:
6234  None.
6235  Parameters:
6236  index - Identifier for the device instance to be configured
6237  mode - For possible data flow configurations, refer to
6238  USART_HANDSHAKE_MODE
6239  Returns:
6240  None.
6241  Example:
6242  <code>
6243 #define MY_USART_INSTANCE USART_ID_1
6244  PLIB_USART_HandshakeModeSelect(MY_USART_INSTANCE, \
6245  USART_HANDSHAKE_MODE_SIMPLEX);
6246  </code>
6247  Remarks:
6248  This feature may not be available on all devices. Please refer to the
6249  specific device data sheet to determine availability or use
6250  PLIB_USART_ExistsHandshakeMode in your application to determine
6251  whether this feature is available.
6252 */
6253 
6254 void
6256  USART_MODULE_ID index ,
6257  USART_HANDSHAKE_MODE handshakeConfig ) ;
6258 //******************************************************************************
6259 /* Function:
6260  void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index,
6261  int8_t Mask)
6262  Summary:
6263  Setup the automatic Address Detect mode.
6264  Description:
6265  This function configures the automatic Address Detect mode. Uses the mask as
6266  the address character for automatic address detection.
6267  This operation is atomic.
6268  Precondition:
6269  None.
6270  Parameters:
6271  index - Identifier for the device instance to be configured
6272  Mask - Address character to be used, when enabled
6273  Returns:
6274  None.
6275  Example:
6276  <code>
6277 #define MY_USART_INSTANCE USART_ID_1
6278  PLIB_USART_ReceiverAddressAutoDetectEnable(MY_USART_INSTANCE,
6279  MY_DEVICE_ADDRESS);
6280  </code>
6281  Remarks:
6282  This feature may not be available on all devices. Please refer to the
6283  specific device data sheet to determine availability or use
6284  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6285  whether this feature is available.
6286 */
6287 
6288 void
6290  USART_MODULE_ID index ,
6291  int8_t Mask ) ;
6292 //******************************************************************************
6293 /* Function:
6294  void PLIB_USART_ReceiverAddressAutoDetectDisable (
6295  USART_MODULE_ID index )
6296  Summary:
6297  Disables the automatic Address Detect mode.
6298  Description:
6299  This function disables the automatic Address Detect mode.
6300  This operation is atomic.
6301  Precondition:
6302  None.
6303  Parameters:
6304  index - Identifier for the device instance to be configured
6305  Returns:
6306  None.
6307  Example:
6308  <code>
6309 #define MY_USART_INSTANCE USART_ID_1
6310  PLIB_USART_ReceiverAddressAutoDetectDisable(MY_USART_INSTANCE);
6311  </code>
6312  Remarks:
6313  This feature may not be available on all devices. Please refer to the
6314  specific device data sheet to determine availability or use
6315  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6316  whether this feature is available.
6317 */
6318 
6319 void
6321  USART_MODULE_ID index ) ;
6322 //******************************************************************************
6323 /* Function:
6324  void PLIB_USART_IrDAEnable ( USART_MODULE_ID index )
6325  Summary:
6326  Enables the IrDA encoder and decoder.
6327  Description:
6328  This function enables the IrDA encoder and decoder.
6329  This operation is atomic.
6330  Precondition:
6331  None.
6332  Parameters:
6333  index - Identifier for the device instance to be configured
6334  Returns:
6335  None.
6336  Example:
6337  <code>
6338 #define MY_USART_INSTANCE USART_ID_1
6339  PLIB_USART_IrDAEnable(MY_USART_INSTANCE);
6340  </code>
6341  Remarks:
6342  This feature may not be available on all devices. Please refer to the
6343  specific device data sheet to determine availability or use
6344  PLIB_USART_ExistsIrDA in your application to determine
6345  whether this feature is available.
6346 */
6347 
6348 void
6350  USART_MODULE_ID index ) ;
6351 //******************************************************************************
6352 /* Function:
6353  void PLIB_USART_IrDADisable ( USART_MODULE_ID index )
6354  Summary:
6355  Disables the IrDA encoder and decoder.
6356  Description:
6357  This function disables the IrDA encoder and decoder.
6358  This operation is atomic.
6359  Precondition:
6360  None.
6361  Parameters:
6362  index - Identifier for the device instance to be configured
6363  Returns:
6364  None.
6365  Example:
6366  <code>
6367 #define MY_USART_INSTANCE USART_ID_1
6368  PLIB_USART_IrDADisable(MY_USART_INSTANCE);
6369  </code>
6370  Remarks:
6371  By default, the IrDA Encoder and Decoder are disabled.
6372 
6373  This feature may not be available on all devices. Please refer to the
6374  specific device data sheet to determine availability or use
6375  PLIB_USART_ExistsIrDA in your application to determine
6376  whether this feature is available.
6377 */
6378 
6379 void
6381  USART_MODULE_ID index ) ;
6382 //******************************************************************************
6383 /* Function:
6384  void PLIB_USART_LoopbackEnable ( USART_MODULE_ID index )
6385  Summary:
6386  Enables Loopback mode.
6387  Description:
6388  This function enables Loopback mode.
6389  This operation is atomic.
6390  Precondition:
6391  None.
6392  Parameters:
6393  index - Identifier for the device instance to be configured
6394  Returns:
6395  None.
6396  Example:
6397  <code>
6398 #define MY_USART_INSTANCE USART_ID_1
6399  PLIB_USART_LoopbackEnable(MY_USART_INSTANCE);
6400  </code>
6401  Remarks:
6402  By default, Loopback mode is disabled.
6403 
6404  This feature may not be available on all devices. Please refer to the
6405  specific device data sheet to determine availability or use
6406  PLIB_USART_ExistsLoopback in your application to determine
6407  whether this feature is available.
6408 */
6409 
6410 void
6412  USART_MODULE_ID index ) ;
6413 //******************************************************************************
6414 /* Function:
6415  void PLIB_USART_LoopbackDisable ( USART_MODULE_ID index )
6416  Summary:
6417  Disables Loopback mode.
6418  Description:
6419  This function disables Loopback mode.
6420  This operation is atomic.
6421  Precondition:
6422  None.
6423  Parameters:
6424  index - Identifier for the device instance to be configured
6425  Returns:
6426  None.
6427  Example:
6428  <code>
6429 #define MY_USART_INSTANCE USART_ID_1
6430  PLIB_USART_LoopbackDisable(MY_USART_INSTANCE);
6431  </code>
6432  Remarks:
6433  By default, Loopback mode is disabled.
6434  This feature may not be available on all devices. Please refer to the
6435  specific device data sheet to determine availability or use
6436  PLIB_USART_ExistsLoopback in your application to determine
6437  whether this feature is available.
6438 */
6439 
6440 void
6442  USART_MODULE_ID index ) ;
6443 //******************************************************************************
6444 /* Function:
6445  void PLIB_USART_OperationModeSelect(USART_MODULE_ID index,
6446  USART_OPERATION_MODE operationmode)
6447  Summary:
6448  Configures the operation mode of the USART module.
6449  Description:
6450  This function configures the operation mode of the USART (i.e., controls the
6451  pins used by the USART module). Refer to USART_OPERATION_MODE for the
6452  possible settings.
6453  Precondition:
6454  None.
6455  Parameters:
6456  index - Identifier for the device instance to be configured
6457  operationmode - One of the possible values from USART_OPERATION_MODE
6458  Returns:
6459  None.
6460  Example:
6461  <code>
6462 #define MY_USART_INSTANCE USART_ID_1
6463  PLIB_USART_OperationModeSelect(MY_USART_INSTANCE, USART_ENABLE_TX_RX_BCLK_USED);
6464  </code>
6465  Remarks:
6466  This feature may not be available on all devices. Please refer to the
6467  specific device data sheet to determine availability or use
6468  PLIB_USART_ExistsOperationMode in your application to determine
6469  whether this feature is available.
6470 */
6471 
6472 void
6474  USART_MODULE_ID index ,
6475  USART_OPERATION_MODE operationmode ) ;
6476 //******************************************************************************
6477 /* Function:
6478  void PLIB_USART_StopInIdleEnable ( USART_MODULE_ID index )
6479  Summary:
6480  Discontinues operation when the device enters Idle mode.
6481  Description:
6482  This function enables the USART module to discontinue operation when the
6483  device enters Idle mode.
6484  This operation is atomic.
6485  Precondition:
6486  None.
6487  Parameters:
6488  index - Identifier for the device instance to be configured
6489  Returns:
6490  None.
6491  Example:
6492  <code>
6493 #define MY_USART_INSTANCE USART_ID_1
6494  PLIB_USART_StopInIdleEnable(MY_USART_INSTANCE);
6495  </code>
6496  Remarks:
6497  This feature may not be available on all devices. Please refer to the
6498  specific device data sheet to determine availability or use
6499  PLIB_USART_ExistsStopInIdle in your application to determine
6500  whether this feature is available.
6501 */
6502 
6503 void
6505  USART_MODULE_ID index ) ;
6506 //******************************************************************************
6507 /* Function:
6508  void PLIB_USART_StopInIdleDisable ( USART_MODULE_ID index )
6509  Summary:
6510  Disables the Stop in Idle mode (the USART module continues operation when
6511  the device is in Idle mode).
6512  Description:
6513  This function disables the Stop in Idle mode. The USART module continues
6514  operation when the device is in Idle mode.
6515  This operation is atomic.
6516  Precondition:
6517  None.
6518  Parameters:
6519  index - Identifier for the device instance to be configured
6520  Returns:
6521  None.
6522  Example:
6523  <code>
6524 #define MY_USART_INSTANCE USART_ID_1
6525  PLIB_USART_StopInIdleDisable(MY_USART_INSTANCE);
6526  </code>
6527  Remarks:
6528  By default, the USART module will continue operation in Idle mode.
6529 
6530  This feature may not be available on all devices. Please refer to the
6531  specific device data sheet to determine availability or use
6532  PLIB_USART_ExistsStopInIdle in your application to determine
6533  whether this feature is available.
6534 */
6535 
6536 void
6538  USART_MODULE_ID index ) ;
6539 //******************************************************************************
6540 /* Function:
6541  void PLIB_USART_WakeOnStartEnable ( USART_MODULE_ID index )
6542  Summary:
6543  Enables the wake-up on start bit detection feature during Sleep mode.
6544  Description:
6545  This function enables the wake-up on start feature during Sleep mode.
6546  This operation is atomic.
6547  Precondition:
6548  None.
6549  Parameters:
6550  index - Identifier for the device instance to be configured
6551  Returns:
6552  None.
6553  Example:
6554  <code>
6555 #define MY_USART_INSTANCE USART_ID_1
6556  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
6557  </code>
6558  Remarks:
6559  This feature may not be available on all devices. Please refer to the
6560  specific device data sheet to determine availability or use
6561  PLIB_USART_ExistsWakeOnStart in your application to determine
6562  whether this feature is available.
6563 */
6564 
6565 void
6567  USART_MODULE_ID index ) ;
6568 //******************************************************************************
6569 /* Function:
6570  void PLIB_USART_WakeOnStartDisable ( USART_MODULE_ID index )
6571  Summary:
6572  Disables the wake-up on start bit detection feature during Sleep mode.
6573  Description:
6574  This function disables the wake-up on start bit detection feature during
6575  Sleep mode.
6576  This operation is atomic.
6577  Precondition:
6578  None.
6579  Parameters:
6580  index - Identifier for the device instance to be configured
6581  Returns:
6582  None.
6583  Example:
6584  <code>
6585 #define MY_USART_INSTANCE USART_ID_1
6586  PLIB_USART_WakeOnStartDisable(MY_USART_INSTANCE);
6587  </code>
6588  Remarks:
6589  This feature may not be available on all devices. Please refer to the
6590  specific device data sheet to determine availability or use
6591  PLIB_USART_ExistsWakeOnStart in your application to determine
6592  whether this feature is available.
6593 */
6594 
6595 void
6597  USART_MODULE_ID index ) ;
6598 //******************************************************************************
6599 /* Function:
6600  bool PLIB_USART_WakeOnStartIsEnabled ( USART_MODULE_ID index )
6601  Summary:
6602  Gets the state of the sync break event completion.
6603  Description:
6604  This function returns the status of the sync break event, when called
6605  after enabling using PLIB_USART_WakeOnStartEnable.
6606  This operation is atomic.
6607  Precondition:
6608  None.
6609  Parameters:
6610  index - Identifier for the device instance to be configured
6611  Returns:
6612  None.
6613  Example:
6614  <code>
6615 #define MY_USART_INSTANCE USART_ID_1
6616  //Call the interface just prior to entering the sleep mode.
6617  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
6618  // Check the status if the Sync break event is over.
6619  if(PLIB_USART_WakeOnStartIsEnabled(MY_USART_INSTANCE))
6620  {
6621  // Do Something
6622  }
6623  </code>
6624  Remarks:
6625  This feature may not be available on all devices. Please refer to the
6626  specific device data sheet to determine availability or use
6627  PLIB_USART_ExistsWakeOnStart in your application to determine
6628  whether this feature is available.
6629 */
6630 
6631 bool
6633  USART_MODULE_ID index ) ;
6634 //******************************************************************************
6635 /* Function:
6636  void PLIB_USART_InitializeModeGeneral( USART_MODULE_ID index, bool autobaud,
6637  bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle );
6638  Summary:
6639  Enables or disables general features of the USART module.
6640  Description:
6641  This function enables or disables general features of the USART module.
6642  Precondition:
6643  None.
6644  Parameters:
6645  index - Identifier for the device instance to be configured
6646  autobaud - If true, auto baud rate detection is enabled. If false
6647  the feature is disabled.
6648  loopBackMode - If true, loop back is enabled. If false the feature is
6649  disabled.
6650  wakeFromSleep - If true, the USART module will wake up the CPU from sleep
6651  mode on USART activity. If false the feature is disabled.
6652  irdaMode - If true, the IrDA mode is enabled. If false the feature
6653  is disabled.
6654  stopInIdle - If true, module will stop functioning when CPU enters Idle
6655  mode. If false, the feature is disabled.
6656  Returns:
6657  None.
6658  Example:
6659  <code>
6660 #define MY_USART_INSTANCE USART_ID_1
6661  // Enable loopback, disable IrDA, disable auto baud detection and disable
6662  // wake from sleep. Enable stop in idle
6663  PLIB_USART_InitializeModeGeneral(MY_USART_INSTANCE, false, true,
6664  false, false, true);
6665  </code>
6666  Remarks:
6667  Enabling the wake from sleep feature will cause the first character that is
6668  received by the USART module to be discarded. This feature should only be
6669  enabled if the CPU is to placed in power saving mode.
6670 
6671  This feature may not be available on all devices. Please refer to the
6672  specific device data sheet to determine availability. Availability of this
6673  function can also be determined if all of the following functions return
6674  true:
6675  - PLIB_USART_ExistsLoopback
6676  - PLIB_USART_ExistsBaudRateAutoDetect
6677  - PLIB_USART_ExistsWakeOnStart
6678  - PLIB_USART_ExistsIrDA
6679  - PLIB_USART_ExistsStopInIdle
6680 */
6681 
6682 void
6684  USART_MODULE_ID index ,
6685  bool autobaud ,
6686  bool loopBackMode ,
6687  bool wakeFromSleep ,
6688  bool irdaMode ,
6689  bool stopInIdle ) ;
6690 //******************************************************************************
6691 /* Function:
6692  void PLIB_USART_InitializeOperation( USART_MODULE_ID index ,
6693  USART_RECEIVE_INTR_MODE receiveInterruptMode,
6694  USART_TRANSMIT_INTR_MODE transmitInterruptMode,
6695  USART_OPERATION_MODE operationMode);
6696  Summary:
6697  Configures the Receive and Transmit FIFO interrupt levels and the hardware
6698  lines to be used by the module.
6699  Description:
6700  This function configures the Receive and Transmit FIFO interrupt levels and
6701  the hardware lines to be used by the module.
6702  Precondition:
6703  None.
6704  Parameters:
6705  index - Identifier for the device instance to be configured
6706  receiveInterruptMode - Receiver FIFO interrupt level
6707  transmitInterruptMode - Transmit FIFO interrupt level
6708  operationMode - Hardware lines to be used by the USART.
6709  Returns:
6710  None.
6711  Example:
6712  <code>
6713 #define MY_USART_INSTANCE USART_ID_1
6714  // Set receive FIFO to interrupt when FIFO is 3/4 level full
6715  // Set Transmit FIFO to interrupt when FIFO is empty
6716  // USART module will only use RX and TX hardware lines
6717  PLIB_USART_InitializeOperation(MY_USART_INSTANCE, USART_RECEIVE_FIFO_3B4FULL,
6718  USART_TRANSMIT_FIFO_EMPTY , USART_ENABLE_TX_RX_USED);
6719  </code>
6720  Remarks:
6721  This feature may not be available on all devices. Please refer to the
6722  specific device data sheet to determine availability. Availability of this
6723  function can also be determined if all of the following functions return
6724  true:
6725  - PLIB_USART_ExistsReceiverInterruptMode
6726  - PLIB_USART_ExistsTransmitterInterruptMode
6727  - PLIB_USART_ExistsOperationMode
6728 */
6729 
6730 void
6732  USART_MODULE_ID index ,
6733  USART_RECEIVE_INTR_MODE receiveInterruptMode ,
6734  USART_TRANSMIT_INTR_MODE transmitInterruptMode ,
6735  USART_OPERATION_MODE operationMode ) ;
6736 //******************************************************************************
6737 /* Function:
6738  void PLIB_USART_BaudSetAndEnable ( USART_MODULE_ID index, uint32_t
6739  clockFrequency, uint32_t baudRate );
6740  Summary:
6741  Sets the baud rate to the desired value and enables the USART receiver,
6742  transmitter and the USART module.
6743  Description:
6744  This function sets the baud rate to the desired value and enables the USART
6745  receiver, USART transmitter and USART module.
6746  Precondition:
6747  None.
6748  Parameters:
6749  index - Identifier for the device instance to be configured
6750  baudRate - Baud Rate Value
6751  clockFrequency - Clock Frequency
6752  Returns:
6753  None.
6754  Example:
6755  <code>
6756 #define MY_USART_INSTANCE USART_ID_1
6757  uint32_t baudRateValue ;
6758  PLIB_USART_BaudSetAndEnable(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
6759  </code>
6760  Remarks:
6761  Setting a new baud rate value causes the baud rate timer to reset.
6762  This ensures that the baud rate timer does not have to overflow before
6763  outputting the new baud rate.
6764 
6765  If the system clock is changed during an active receive operation, a
6766  receiver error or data loss may result. To avoid this issue verify that
6767  no receptions are in progress before changing the system clock.
6768 
6769  This feature may not be available on all devices. Please refer to the
6770  specific device data sheet to determine availability. Availability of this
6771  function can also be determined if all of the following functions return
6772  true:
6773  - PLIB_USART_ExistsBaudRate
6774  - PLIB_USART_ExistsTransmitterEnable
6775  - PLIB_USART_ExistsReceiverEnable
6776  - PLIB_USART_ExistsEnable
6777 */
6778 
6779 void
6781  USART_MODULE_ID index ,
6782  uint32_t systemClock ,
6783  uint32_t baud ) ;
6784 //******************************************************************************
6785 /* Function:
6786  USART_ERROR PLIB_USART_ErrorsGet ( USART_MODULE_ID index )
6787  Summary:
6788  Return the status of all errors in the specified USART module.
6789  Description:
6790  This function returns status of all errors in the specified USART module.
6791  The return value can be bitwise AND'ed with a USART_ERROR type to know the
6792  status of a specific error.
6793  This operation is atomic.
6794  Precondition:
6795  None.
6796  Parameters:
6797  index - Identifier for the device instance to be configured
6798  Returns:
6799  Returns a bitmap of USART error status.
6800  Example:
6801  <code>
6802 #define MY_USART_INSTANCE USART_ID_1
6803  USART_ERROR error;
6804  // Get the status of all errors.
6805  error = PLIB_USART_ErrorsGet(MY_USART_INSTANCE);
6806  // Check if parity error is active
6807  if(error & USART_ERROR_PARITY)
6808  {
6809  // Parity error is active.
6810  }
6811  else if(error & USART_ERROR_FRAMING)
6812  {
6813  // Framing error is active.
6814  }
6815  </code>
6816  Remarks:
6817  This feature may not be available on all devices. Please refer to the
6818  specific device data sheet to determine availability. Availability of this
6819  function can also be determined if all of the followings functions return
6820  true:
6821  - PLIB_USART_ExistsReceiverFramingErrorStatus
6822  - PLIB_USART_ExistsReceiverParityErrorStatus
6823  - PLIB_USART_ExistsReceiverOverrunStatus
6824 */
6825 
6826 USART_ERROR
6828  USART_MODULE_ID index ) ;
6829 //******************************************************************************
6830 /* Function:
6831  PLIB_USART_TransmitterAddressGet( USART_MODULE_ID index )
6832  Summary:
6833  Returns the address of the USART TX register
6834  Description:
6835  This function returns the address of the USART TX register.
6836  This operation is atomic.
6837  Preconditions:
6838  None.
6839  Parameters:
6840  index - Identifier for the device instance
6841  Returns:
6842  Address of the USART TX register
6843  Remarks:
6844  None.
6845 */
6846 
6847 void *
6849  USART_MODULE_ID index ) ;
6850 //******************************************************************************
6851 /* Function:
6852  PLIB_USART_ReceiverAddressGet( USART_MODULE_ID index )
6853  Summary:
6854  Returns the address of the USART RX register
6855  Description:
6856  This function returns the address of the USART RX register.
6857  This operation is atomic.
6858  Preconditions:
6859  None.
6860  Parameters:
6861  index - Identifier for the device instance
6862  Returns:
6863  Address of the USART RX register
6864  Remarks:
6865  None.
6866 */
6867 
6868 void *
6870  USART_MODULE_ID index ) ;
6871 // *****************************************************************************
6872 // *****************************************************************************
6873 // Section: USART Peripheral Library Exists Functions
6874 // *****************************************************************************
6875 // *****************************************************************************
6876 /* The following functions indicate the existence of the features on the device.
6877 */
6878 //******************************************************************************
6879 /* Function:
6880  PLIB_USART_ExistsRunInOverflow ( USART_MODULE_ID index )
6881  Summary:
6882  Identifies whether the Run in overflow condition feature exists on the USART module.
6883  Description:
6884  This function identifies whether the Run in Overflow condition feature is
6885  available on the USART module. When this function returns true, these
6886  functions are supported on the device:
6887  - PLIB_USART_RunInOverflowEnable
6888  - PLIB_USART_RunInOverflowDisable
6889  - PLIB_USART_RunInOverflowIsEnabled
6890  This operation is atomic.
6891  Preconditions:
6892  None.
6893  Parameters:
6894  index - Identifier for the device instance
6895  Returns:
6896  - true - The Run in Overflow condition feature is supported on the device
6897  - false - The Run in Overflow condition feature is not supported on the device
6898  Remarks:
6899  None.
6900 */
6901 
6902 bool
6904  USART_MODULE_ID index ) ;
6905 //******************************************************************************
6906 /* Function:
6907  PLIB_USART_ExistsBRGClockSourceSelect ( USART_MODULE_ID index )
6908  Summary:
6909  Identifies whether the BRG Clock source select feature exists on the
6910  USART module.
6911  Description:
6912  This function identifies whether the BRG Clock source select feature is
6913  available on the USART module. When this function returns true, these
6914  functions are supported on the device:
6915  - PLIB_USART_BRGClockSourceSelect
6916  - PLIB_USART_BRGClockSourceGet
6917  This operation is atomic.
6918  Preconditions:
6919  None.
6920  Parameters:
6921  index - Identifier for the device instance
6922  Returns:
6923  - true - The BRG clock source select feature is supported on the device
6924  - false - The BRG clock source select feature is not supported on the device
6925  Remarks:
6926  None.
6927 */
6928 
6929 bool
6931  USART_MODULE_ID index ) ;
6932 //******************************************************************************
6933 /* Function:
6934  PLIB_USART_ExistsModuleBusyStatus ( USART_MODULE_ID index )
6935  Summary:
6936  Identifies whether the module running status feature exists on the
6937  USART module.
6938  Description:
6939  This function identifies whether the module running status feature is
6940  available on the USART module. When this function returns true, this
6941  function is supported on the device:
6942  - PLIB_USART_ModuleIsBusy
6943  This operation is atomic.
6944  Preconditions:
6945  None.
6946  Parameters:
6947  index - Identifier for the device instance
6948  Returns:
6949  - true - The Module running status feature is supported on the device
6950  - false - The Module running status feature is not supported on the device
6951  Remarks:
6952  None.
6953 */
6954 
6955 bool
6957  USART_MODULE_ID index ) ;
6958 //******************************************************************************
6959 /* Function:
6960  PLIB_USART_ExistsRunInSleepMode ( USART_MODULE_ID index )
6961  Summary:
6962  Identifies whether the Run in Sleep mode feature exists on the USART module.
6963  Description:
6964  This function identifies whether the Run in Sleep mode feature is
6965  available on the USART module. When this function returns true, these
6966  functions are supported on the device:
6967  - PLIB_USART_RunInSleepModeEnable
6968  - PLIB_USART_RunInSleepModeDisable
6969  - PLIB_USART_RunInSleepModeIsEnabled
6970  This operation is atomic.
6971  Preconditions:
6972  None.
6973  Parameters:
6974  index - Identifier for the device instance
6975  Returns:
6976  - true - The Run in Sleep mode feature is supported on the device
6977  - false - The Run in Sleep mode feature is not supported on the device
6978  Remarks:
6979  None.
6980 */
6981 
6982 bool
6984  USART_MODULE_ID index ) ;
6985 //******************************************************************************
6986 /* Function:
6987  PLIB_USART_ExistsEnable( USART_MODULE_ID index )
6988  Summary:
6989  Identifies whether the EnableControl feature exists on the USART module.
6990  Description:
6991  This function identifies whether the EnableControl feature is
6992  available on the USART module. When this function returns true, these
6993  functions are supported on the device:
6994  - PLIB_USART_Disable
6995  - PLIB_USART_Enable
6996  This operation is atomic.
6997  Preconditions:
6998  None.
6999  Parameters:
7000  index - Identifier for the device instance
7001  Returns:
7002  - true - The EnableControl feature is supported on the device
7003  - false - The EnableControl feature is not supported on the device
7004  Remarks:
7005  None.
7006 */
7007 
7008 bool
7010  USART_MODULE_ID index ) ;
7011 //******************************************************************************
7012 /* Function:
7013  PLIB_USART_ExistsHandshakeMode( USART_MODULE_ID index )
7014  Summary:
7015  Identifies whether the HandShakeMode feature exists on the USART module.
7016  Description:
7017  This function identifies whether the HandShakeMode feature is
7018  available on the USART module. When this function returns true, this
7019  function is supported on the device:
7020  - PLIB_USART_HandshakeModeSelect
7021  This operation is atomic.
7022  Preconditions:
7023  None.
7024  Parameters:
7025  index - Identifier for the device instance
7026  Returns:
7027  - true - The HandShakeMode feature is supported on the device
7028  - false - The HandShakeMode feature is not supported on the device
7029  Remarks:
7030  None.
7031 */
7032 
7033 bool
7035  USART_MODULE_ID index ) ;
7036 //******************************************************************************
7037 /* Function:
7038  PLIB_USART_ExistsIrDA( USART_MODULE_ID index )
7039  Summary:
7040  Identifies whether the IrDAControl feature exists on the USART module.
7041  Description:
7042  This function identifies whether the IrDAControl feature is
7043  available on the USART module. When this function returns true, these
7044  functions are supported on the device:
7045  - PLIB_USART_IrDADisable
7046  - PLIB_USART_IrDAEnable
7047  This operation is atomic.
7048  Preconditions:
7049  None.
7050  Parameters:
7051  index - Identifier for the device instance
7052  Returns:
7053  - true - The IrDAControl feature is supported on the device
7054  - false - The IrDAControl feature is not supported on the device
7055  Remarks:
7056  None.
7057 */
7058 
7059 bool
7061  USART_MODULE_ID index ) ;
7062 //******************************************************************************
7063 /* Function:
7064  PLIB_USART_ExistsLineControlMode( USART_MODULE_ID index )
7065  Summary:
7066  Identifies whether the LineControlMode feature exists on the USART module.
7067  Description:
7068  This function identifies whether the LineControlMode feature is
7069  available on the USART module. When this function returns true, this
7070  function is supported on the device:
7071  - PLIB_USART_LineControlModeSelect
7072  This operation is atomic.
7073  Preconditions:
7074  None.
7075  Parameters:
7076  index - Identifier for the device instance
7077  Returns:
7078  - true - The LineControlMode feature is supported on the device
7079  - false - The LineControlMode feature is not supported on the device
7080  Remarks:
7081  None.
7082 */
7083 
7084 bool
7086  USART_MODULE_ID index ) ;
7087 //******************************************************************************
7088 /* Function:
7089  PLIB_USART_ExistsLoopback( USART_MODULE_ID index )
7090  Summary:
7091  Identifies whether the Loopback feature exists on the USART module.
7092  Description:
7093  This function identifies whether the Loopback feature is
7094  available on the USART module. When this function returns true, these
7095  functions are supported on the device:
7096  - PLIB_USART_LoopbackEnable
7097  - PLIB_USART_LoopbackDisable
7098  This operation is atomic.
7099  Preconditions:
7100  None.
7101  Parameters:
7102  index - Identifier for the device instance
7103  Returns:
7104  - true - The Loopback feature is supported on the device
7105  - false - The Loopback feature is not supported on the device
7106  Remarks:
7107  None.
7108 */
7109 
7110 bool
7112  USART_MODULE_ID index ) ;
7113 //******************************************************************************
7114 /* Function:
7115  PLIB_USART_ExistsOperationMode( USART_MODULE_ID index )
7116  Summary:
7117  Identifies whether the OperationMode feature exists on the USART module.
7118  Description:
7119  This function identifies whether the OperationMode feature is
7120  available on the USART module. When this function returns true, this
7121  function is supported on the device:
7122  - PLIB_USART_OperationModeSelect
7123  This operation is atomic.
7124  Preconditions:
7125  None.
7126  Parameters:
7127  index - Identifier for the device instance
7128  Returns:
7129  - true - The OperationMode feature is supported on the device
7130  - false - The OperationMode feature is not supported on the device
7131  Remarks:
7132  None.
7133 */
7134 
7135 bool
7137  USART_MODULE_ID index ) ;
7138 //******************************************************************************
7139 /* Function:
7140  PLIB_USART_ExistsStopInIdle( USART_MODULE_ID index )
7141  Summary:
7142  Identifies whether the StopInIdle feature exists on the USART module.
7143  Description:
7144  This function identifies whether the StopInIdle feature is
7145  available on the USART module. When this function returns true, these
7146  functions are supported on the device:
7147  - PLIB_USART_StopInIdleEnable
7148  - PLIB_USART_StopInIdleDisable
7149  This operation is atomic.
7150  Preconditions:
7151  None.
7152  Parameters:
7153  index - Identifier for the device instance
7154  Returns:
7155  - true - The StopInIdle feature is supported on the device
7156  - false - The StopInIdle feature is not supported on the device
7157  Remarks:
7158  None.
7159 */
7160 
7161 bool
7163  USART_MODULE_ID index ) ;
7164 //******************************************************************************
7165 /* Function:
7166  PLIB_USART_ExistsWakeOnStart( USART_MODULE_ID index )
7167  Summary:
7168  Identifies whether the WakeOnStart feature exists on the USART module.
7169  Description:
7170  This function identifies whether the WakeOnStart feature is
7171  available on the USART module. When this function returns true, these
7172  functions are supported on the device:
7173  - PLIB_USART_WakeOnStartEnable
7174  - PLIB_USART_WakeOnStartDisable
7175  - PLIB_USART_WakeOnStartIsEnabled
7176  This operation is atomic.
7177  Preconditions:
7178  None.
7179  Parameters:
7180  index - Identifier for the device instance
7181  Returns:
7182  - true - The WakeOnStart feature is supported on the device
7183  - false - The WakeOnStart feature is not supported on the device
7184  Remarks:
7185  None.
7186 */
7187 
7188 bool
7190  USART_MODULE_ID index ) ;
7191 //******************************************************************************
7192 /* Function:
7193  PLIB_USART_ExistsBaudRate( USART_MODULE_ID index )
7194  Summary:
7195  Identifies whether the BaudRate feature exists on the USART module.
7196  Description:
7197  This function identifies whether the BaudRate feature is
7198  available on the USART module. When this function returns true, these
7199  functions are supported on the device:
7200  - PLIB_USART_BaudRateSet
7201  - PLIB_USART_BaudRateGet
7202  This operation is atomic.
7203  Preconditions:
7204  None.
7205  Parameters:
7206  index - Identifier for the device instance
7207  Returns:
7208  - true - The BaudRate feature is supported on the device
7209  - false - The BaudRate feature is not supported on the device
7210  Remarks:
7211  None.
7212 */
7213 
7214 bool
7216  USART_MODULE_ID index ) ;
7217 //******************************************************************************
7218 /* Function:
7219  PLIB_USART_ExistsBaudRateAutoDetect( USART_MODULE_ID index )
7220  Summary:
7221  Identifies whether the BaudRateAutoDetect feature exists on the USART module.
7222  Description:
7223  This function identifies whether the BaudRateAutoDetect feature is
7224  available on the USART module. When this function returns true, these
7225  functions are supported on the device:
7226  - PLIB_USART_BaudRateAutoDetectEnable
7227  - PLIB_USART_BaudRateAutoDetectIsComplete
7228  This operation is atomic.
7229  Preconditions:
7230  None.
7231  Parameters:
7232  index - Identifier for the device instance
7233  Returns:
7234  - true - The BaudRateAutoDetect feature is supported on the device
7235  - false - The BaudRateAutoDetect feature is not supported on the device
7236  Remarks:
7237  None.
7238 */
7239 
7240 bool
7242  USART_MODULE_ID index ) ;
7243 //******************************************************************************
7244 /* Function:
7245  PLIB_USART_ExistsBaudRateHigh( USART_MODULE_ID index )
7246  Summary:
7247  Identifies whether the BaudRateHigh feature exists on the USART module.
7248  Description:
7249  This function identifies whether the BaudRateHigh feature is
7250  available on the USART module. When this function returns true, these
7251  functions are supported on the device:
7252  - PLIB_USART_BaudRateHighSet
7253  - PLIB_USART_BaudRateHighDisable
7254  - PLIB_USART_BaudRateHighEnable
7255  This operation is atomic.
7256  Preconditions:
7257  None.
7258  Parameters:
7259  index - Identifier for the device instance
7260  Returns:
7261  - true - The BaudRateHigh feature is supported on the device
7262  - false - The BaudRateHigh feature is not supported on the device
7263  Remarks:
7264  None.
7265 */
7266 
7267 bool
7269  USART_MODULE_ID index ) ;
7270 //******************************************************************************
7271 /* Function:
7272  PLIB_USART_ExistsReceiverAddress ( USART_MODULE_ID index )
7273  Summary:
7274  Identifies whether the Receiver Address feature exists on the USART
7275  module.
7276  Description:
7277  This function identifies whether the Receiver Address feature is
7278  available on the USART module. When this function returns true, these
7279  functions are supported on the device:
7280  - PLIB_USART_AddressSet
7281  - PLIB_USART_AddressGet
7282  This operation is atomic.
7283  Preconditions:
7284  None.
7285  Parameters:
7286  index - Identifier for the device instance
7287  Returns:
7288  - true - The Receiver address feature is supported on the device
7289  - false - The Receiver address feature is not supported on the device
7290  Remarks:
7291  None.
7292 */
7293 
7294 bool
7296  USART_MODULE_ID index ) ;
7297 //******************************************************************************
7298 /* Function:
7299  PLIB_USART_ExistsReceiverAddressMask ( USART_MODULE_ID index )
7300  Summary:
7301  Identifies whether the Receiver Address Mask feature exists on the USART
7302  module.
7303  Description:
7304  This function identifies whether the Receiver Address Mask feature is
7305  available on the USART module. When this function returns true, these
7306  functions are supported on the device:
7307  - PLIB_USART_AddressMaskSet
7308  - PLIB_USART_AddressMaskGet
7309  This operation is atomic.
7310  Preconditions:
7311  None.
7312  Parameters:
7313  index - Identifier for the device instance
7314  Returns:
7315  - true - The Receiver address mask feature is supported on the device
7316  - false - The Receiver address mask feature is not supported on the device
7317  Remarks:
7318  None.
7319 */
7320 
7321 bool
7323  USART_MODULE_ID index ) ;
7324 //******************************************************************************
7325 /* Function:
7326  PLIB_USART_ExistsReceiver( USART_MODULE_ID index )
7327  Summary:
7328  Identifies whether the Receiver feature exists on the USART module.
7329  Description:
7330  This function identifies whether the Receiver feature is available on the
7331  USART module. When this function returns true, these functions are supported
7332  on the device:
7333  - PLIB_USART_ReceiverByteReceive
7334  - PLIB_USART_ReceiverAddressGet
7335  This operation is atomic.
7336  Preconditions:
7337  None.
7338  Parameters:
7339  index - Identifier for the device instance
7340  Returns:
7341  - true - The Receiver feature is supported on the device
7342  - false - The Receiver feature is not supported on the device
7343  Remarks:
7344  None.
7345 */
7346 
7347 bool
7349  USART_MODULE_ID index ) ;
7350 //******************************************************************************
7351 /* Function:
7352  PLIB_USART_ExistsReceiver9Bits ( USART_MODULE_ID index )
7353  Summary:
7354  Identifies whether the 9 Bits Receiver feature exists on the USART module.
7355  Description:
7356  This function identifies whether the 9 Bits Receiver feature is available on the
7357  USART module. When this function returns true, this function is supported
7358  on the device:
7359  - PLIB_USART_Receiver9BitsReceive
7360  This operation is atomic.
7361  Preconditions:
7362  None.
7363  Parameters:
7364  index - Identifier for the device instance
7365  Returns:
7366  - true - The feature is supported on the device
7367  - false - The feature is not supported on the device
7368  Remarks:
7369  None.
7370 */
7371 
7372 bool
7374  USART_MODULE_ID index ) ;
7375 //******************************************************************************
7376 /* Function:
7377  PLIB_USART_ExistsReceiverAddressAutoDetect( USART_MODULE_ID index )
7378  Summary:
7379  Identifies whether the ReceiverAddressAutoDetect feature exists on the USART module.
7380  Description:
7381  This function identifies whether the ReceiverAddressAutoDetect feature is
7382  available on the USART module. When this function returns true, these
7383  functions are supported on the device:
7384  - PLIB_USART_ReceiverAddressAutoDetectEnable
7385  - PLIB_USART_ReceiverAddressAutoDetectDisable
7386  This operation is atomic.
7387  Preconditions:
7388  None.
7389  Parameters:
7390  index - Identifier for the device instance
7391  Returns:
7392  - true - The ReceiverAddressAutoDetect feature is supported on the device
7393  - false - The ReceiverAddressAutoDetect feature is not supported on the device
7394  Remarks:
7395  None.
7396 */
7397 
7398 bool
7400  USART_MODULE_ID index ) ;
7401 //******************************************************************************
7402 /* Function:
7403  PLIB_USART_ExistsReceiverAddressDetect( USART_MODULE_ID index )
7404  Summary:
7405  Identifies whether the ReceiverAddressDetect feature exists on the USART module.
7406  Description:
7407  This function identifies whether the ReceiverAddressDetect feature is
7408  available on the USART module. When this function returns true, these
7409  functions are supported on the device:
7410  - PLIB_USART_ReceiverAddressDetectEnable
7411  - PLIB_USART_ReceiverAddressDetectDisable
7412  - PLIB_USART_ReceiverAddressIsReceived
7413  This operation is atomic.
7414  Preconditions:
7415  None.
7416  Parameters:
7417  index - Identifier for the device instance
7418  Returns:
7419  - true - The ReceiverAddressDetect feature is supported on the device
7420  - false - The ReceiverAddressDetect feature is not supported on the device
7421  Remarks:
7422  None.
7423 */
7424 
7425 bool
7427  USART_MODULE_ID index ) ;
7428 //******************************************************************************
7429 /* Function:
7430  PLIB_USART_ExistsReceiverDataAvailableStatus( USART_MODULE_ID index )
7431  Summary:
7432  Identifies whether the ReceiverDataAvailable feature exists on the USART
7433  module
7434  Description:
7435  This function identifies whether the ReceiverDataAvailable feature is
7436  available on the USART module. When this function returns true, this
7437  function is supported on the device:
7438  - PLIB_USART_ReceiverDataIsAvailable
7439  This operation is atomic.
7440  Preconditions:
7441  None.
7442  Parameters:
7443  index - Identifier for the device instance
7444  Returns:
7445  - true - The ReceiverDataAvailable feature is supported on the device
7446  - false - The ReceiverDataAvailable feature is not supported on the device
7447  Remarks:
7448  None.
7449 */
7450 
7451 bool
7453  USART_MODULE_ID index ) ;
7454 //******************************************************************************
7455 /* Function:
7456  PLIB_USART_ExistsReceiverEnable( USART_MODULE_ID index )
7457  Summary:
7458  Identifies whether the ReceiverEnableControl feature exists on the USART module.
7459  Description:
7460  This function identifies whether the ReceiverEnableControl feature is
7461  available on the USART module. When this function returns true, these
7462  functions are supported on the device:
7463  - PLIB_USART_ReceiverEnable
7464  - PLIB_USART_ReceiverDisable
7465  This operation is atomic.
7466  Preconditions:
7467  None.
7468  Parameters:
7469  index - Identifier for the device instance
7470  Returns:
7471  - true - The ReceiverEnableControl feature is supported on the device
7472  - false - The ReceiverEnableControl feature is not supported on the device
7473  Remarks:
7474  None.
7475 */
7476 
7477 bool
7479  USART_MODULE_ID index ) ;
7480 //******************************************************************************
7481 /* Function:
7482  PLIB_USART_ExistsReceiverIdleStatus( USART_MODULE_ID index )
7483  Summary:
7484  Identifies whether the ReceiverIdle feature exists on the USART module.
7485  Description:
7486  This function identifies whether the ReceiverIdle feature is
7487  available on the USART module. When this function returns true, this
7488  function is supported on the device:
7489  - PLIB_USART_ReceiverIsIdle
7490  This operation is atomic.
7491  Preconditions:
7492  None.
7493  Parameters:
7494  index - Identifier for the device instance
7495  Returns:
7496  - true - The ReceiverIdle feature is supported on the device
7497  - false - The ReceiverIdle feature is not supported on the device
7498  Remarks:
7499  None.
7500 */
7501 
7502 bool
7504  USART_MODULE_ID index ) ;
7505 //******************************************************************************
7506 /* Function:
7507  PLIB_USART_ExistsReceiverFramingErrorStatus( USART_MODULE_ID index )
7508  Summary:
7509  Identifies whether the ReceiverFramingError feature exists on the USART module.
7510  Description:
7511  This function identifies whether the ReceiverFramingError feature is
7512  available on the USART module. When this function returns true, this
7513  function is supported on the device:
7514  - PLIB_USART_ReceiverFramingErrorHasOccurred
7515  This operation is atomic.
7516  Preconditions:
7517  None.
7518  Parameters:
7519  index - Identifier for the device instance
7520  Returns:
7521  - true - The ReceiverFramingError feature is supported on the device
7522  - false - The ReceiverFramingError feature is not supported on the device
7523  Remarks:
7524  None.
7525 */
7526 
7527 bool
7529  USART_MODULE_ID index ) ;
7530 //******************************************************************************
7531 /* Function:
7532  PLIB_USART_ExistsReceiverInterruptMode( USART_MODULE_ID index )
7533  Summary:
7534  Identifies whether the ReceiverInterruptMode feature exists on the USART module.
7535  Description:
7536  This function identifies whether the ReceiverInterruptMode feature is
7537  available on the USART module. When this function returns true, this
7538  function is supported on the device:
7539  - PLIB_USART_ReceiverInterruptModeSelect
7540  This operation is atomic.
7541  Preconditions:
7542  None.
7543  Parameters:
7544  index - Identifier for the device instance
7545  Returns:
7546  - true - The ReceiverInterruptMode feature is supported on the device
7547  - false - The ReceiverInterruptMode feature is not supported on the device
7548  Remarks:
7549  None.
7550 */
7551 
7552 bool
7554  USART_MODULE_ID index ) ;
7555 //******************************************************************************
7556 /* Function:
7557  PLIB_USART_ExistsReceiverIdleStateLowEnable( USART_MODULE_ID index )
7558  Summary:
7559  Identifies whether the ReceiverPolarityInvert feature exists on the USART module.
7560  Description:
7561  This function identifies whether the ReceiverPolarityInvert feature is
7562  available on the USART module. When this function returns true, these
7563  functions are supported on the device:
7564  - PLIB_USART_ReceiverIdleStateLowEnable
7565  - PLIB_USART_ReceiverIdleStateLowDisable
7566  This operation is atomic.
7567  Preconditions:
7568  None.
7569  Parameters:
7570  index - Identifier for the device instance
7571  Returns:
7572  - true - The ReceiverPolarityInvert feature is supported on the device
7573  - false - The ReceiverPolarityInvert feature is not supported on the device
7574  Remarks:
7575  None.
7576 */
7577 
7578 bool
7580  USART_MODULE_ID index ) ;
7581 //******************************************************************************
7582 /* Function:
7583  PLIB_USART_ExistsReceiverParityErrorStatus( USART_MODULE_ID index )
7584  Summary:
7585  Identifies whether the ReceiverParityError feature exists on the USART module.
7586  Description:
7587  This function identifies whether the ReceiverParityError feature is
7588  available on the USART module. When this function returns true, this
7589  function is supported on the device:
7590  - PLIB_USART_ReceiverParityErrorHasOccurred
7591  This operation is atomic.
7592  Preconditions:
7593  None.
7594  Parameters:
7595  index - Identifier for the device instance
7596  Returns:
7597  - true - The ReceiverParityError feature is supported on the device
7598  - false - The ReceiverParityError feature is not supported on the device
7599  Remarks:
7600  None.
7601 */
7602 
7603 bool
7605  USART_MODULE_ID index ) ;
7606 //******************************************************************************
7607 /* Function:
7608  PLIB_USART_ExistsReceiverOverrunStatus( USART_MODULE_ID index )
7609  Summary:
7610  Identifies whether the ReceiverOverrunError feature exists on the USART module.
7611  Description:
7612  This function identifies whether the ReceiverOverrunError feature is
7613  available on the USART module. When this function returns true, these
7614  functions are supported on the device:
7615  - PLIB_USART_ReceiverOverrunErrorClear
7616  - PLIB_USART_ReceiverOverrunHasOccurred
7617  This operation is atomic.
7618  Preconditions:
7619  None.
7620  Parameters:
7621  index - Identifier for the device instance
7622  Returns:
7623  - true - The ReceiverOverrunError feature is supported on the device
7624  - false - The ReceiverOverrunError feature is not supported on the device
7625  Remarks:
7626  None.
7627 */
7628 
7629 bool
7631  USART_MODULE_ID index ) ;
7632 //******************************************************************************
7633 /* Function:
7634  PLIB_USART_ExistsTransmitter( USART_MODULE_ID index )
7635  Summary:
7636  Identifies whether the Transmitter feature exists on the USART module.
7637  Description:
7638  This function identifies whether the Transmitter feature is
7639  available on the USART module. When this function returns true, these
7640  functions are supported on the device:
7641  - PLIB_USART_TransmitterByteSend
7642  - PLIB_USART_TransmitterAddressGet
7643  This operation is atomic.
7644  Preconditions:
7645  None.
7646  Parameters:
7647  index - Identifier for the device instance
7648  Returns:
7649  - true - The Transmitter feature is supported on the device
7650  - false - The Transmitter feature is not supported on the device
7651  Remarks:
7652  None.
7653 */
7654 
7655 bool
7657  USART_MODULE_ID index ) ;
7658 //******************************************************************************
7659 /* Function:
7660  PLIB_USART_ExistsTransmitter9BitsSend( USART_MODULE_ID index )
7661  Summary:
7662  Identifies whether the Transmitter9Bits feature exists on the USART module.
7663  Description:
7664  This function identifies whether the Transmitter9Bits feature is
7665  available on the USART module. When this function returns true, this
7666  function is supported on the device:
7667  - PLIB_USART_Transmitter9BitsSend
7668  This operation is atomic.
7669  Preconditions:
7670  None.
7671  Parameters:
7672  index - Identifier for the device instance
7673  Returns:
7674  - true - The Transmitter9Bits feature is supported on the device
7675  - false - The Transmitter9Bits feature is not supported on the device
7676  Remarks:
7677  None.
7678 */
7679 
7680 bool
7682  USART_MODULE_ID index ) ;
7683 //******************************************************************************
7684 /* Function:
7685  PLIB_USART_ExistsTransmitterBreak( USART_MODULE_ID index )
7686  Summary:
7687  Identifies whether the TransmitterBreak feature exists on the USART module.
7688  Description:
7689  This function identifies whether the TransmitterBreak feature is
7690  available on the USART module. When this function returns true, these
7691  functions are supported on the device:
7692  - PLIB_USART_TransmitterBreakSend
7693  - PLIB_USART_TransmitterBreakSendIsComplete
7694  This operation is atomic.
7695  Preconditions:
7696  None.
7697  Parameters:
7698  index - Identifier for the device instance
7699  Returns:
7700  - true - The TransmitterBreak feature is supported on the device
7701  - false - The TransmitterBreak feature is not supported on the device
7702  Remarks:
7703  None.
7704 */
7705 
7706 bool
7708  USART_MODULE_ID index ) ;
7709 //******************************************************************************
7710 /* Function:
7711  PLIB_USART_ExistsTransmitterBufferFullStatus( USART_MODULE_ID index )
7712  Summary:
7713  Identifies whether the TransmitterBufferFull feature exists on the USART module.
7714  Description:
7715  This function identifies whether the TransmitterBufferFull feature is
7716  available on the USART module. When this function returns true, this
7717  function is supported on the device:
7718  - PLIB_USART_TransmitterBufferIsFull
7719  This operation is atomic.
7720  Preconditions:
7721  None.
7722  Parameters:
7723  index - Identifier for the device instance
7724  Returns:
7725  - true - The TransmitterBufferFull feature is supported on the device
7726  - false - The TransmitterBufferFull feature is not supported on the device
7727  Remarks:
7728  None.
7729 */
7730 
7731 bool
7733  USART_MODULE_ID index ) ;
7734 //******************************************************************************
7735 /* Function:
7736  PLIB_USART_ExistsTransmitterEmptyStatus( USART_MODULE_ID index )
7737  Summary:
7738  Identifies whether the TransmitterEmpty feature exists on the USART module.
7739  Description:
7740  This function identifies whether the TransmitterEmpty feature is
7741  available on the USART module. When this function returns true, this
7742  function is supported on the device:
7743  - PLIB_USART_TransmitterIsEmpty
7744  This operation is atomic.
7745  Preconditions:
7746  None.
7747  Parameters:
7748  index - Identifier for the device instance
7749  Returns:
7750  - true - The TransmitterEmpty feature is supported on the device
7751  - false - The TransmitterEmpty feature is not supported on the device
7752  Remarks:
7753  None.
7754 */
7755 
7756 bool
7758  USART_MODULE_ID index ) ;
7759 //******************************************************************************
7760 /* Function:
7761  PLIB_USART_ExistsTransmitterEnable( USART_MODULE_ID index )
7762  Summary:
7763  Identifies whether the TransmitterEnableControl feature exists on the USART
7764  module
7765  Description:
7766  This function identifies whether the TransmitterEnableControl feature is
7767  available on the USART module. When this function returns true, these
7768  functions are supported on the device:
7769  - PLIB_USART_TransmitterEnable
7770  - PLIB_USART_TransmitterDisable
7771  This operation is atomic.
7772  Preconditions:
7773  None.
7774  Parameters:
7775  index - Identifier for the device instance
7776  Returns:
7777  - true - The TransmitterEnableControl feature is supported on the device
7778  - false - The TransmitterEnableControl feature is not supported on the device
7779  Remarks:
7780  None.
7781 */
7782 
7783 bool
7785  USART_MODULE_ID index ) ;
7786 //******************************************************************************
7787 /* Function:
7788  PLIB_USART_ExistsTransmitterInterruptMode( USART_MODULE_ID index )
7789  Summary:
7790  Identifies whether the TransmitterInterruptMode feature exists on the USART module.
7791  Description:
7792  This function identifies whether the TransmitterInterruptMode feature is
7793  available on the USART module. When this function returns true, this function
7794  is supported on the device:
7795  - PLIB_USART_TransmitterInterruptModeSelect
7796  This operation is atomic.
7797  Preconditions:
7798  None.
7799  Parameters:
7800  index - Identifier for the device instance
7801  Returns:
7802  - true - The TransmitterInterruptMode feature is supported on the device
7803  - false - The TransmitterInterruptMode feature is not supported on the device
7804  Remarks:
7805  None.
7806 */
7807 
7808 bool
7810  USART_MODULE_ID index ) ;
7811 //******************************************************************************
7812 /* Function:
7813  PLIB_USART_ExistsTransmitterIdleIsLow( USART_MODULE_ID index )
7814  Summary:
7815  Identifies whether the TransmitterIdleIsLow feature exists on the USART module.
7816  Description:
7817  This function identifies whether the TransmitterIdleIsLow feature is available
7818  on the USART module. When this function returns true, these functions are
7819  supported on the device:
7820  - PLIB_USART_TransmitterIdleIsLowDisable
7821  - PLIB_USART_TransmitterIdleIsLowEnable
7822  This operation is atomic.
7823  Preconditions:
7824  None.
7825  Parameters:
7826  index - Identifier for the device instance
7827  Returns:
7828  - true - The TransmitterIdleIsLow feature is supported on the device
7829  - false - The TransmitterIdleIsLow feature is not supported on the device
7830  Remarks:
7831  None.
7832 */
7833 
7834 bool
7836  USART_MODULE_ID index ) ;
7837 //DOM-IGNORE-BEGIN
7838 //DOM-IGNORE-END
7839  // #ifndef _PLIB_USART_H
7840 /******************************************************************************
7841  End of File
7842 */
7843 
7844 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h*/
7845 /* CLOSE_FILE Include File */
7846 
7847 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\system.h */
7848 /*******************************************************************************
7849  System Services Library Interface Header
7850  Company:
7851  Microchip Technology Inc.
7852  File Name:
7853  system.h
7854  Summary:
7855  Top level common system services library interface header.
7856  Description:
7857  This file is the top level common system services library interface header.
7858  It defines (or includes files that define) the common system service
7859  types, prototypes, and other definitions that are commonly used by MPLAB
7860  Harmony libraries and system services.
7861 
7862  System services provide common functionality that would otherwise need to
7863  be duplicated by multiple other modules or that would force them to
7864  interact in complex and hard to manage ways. System services eliminate
7865  conflicts by controlling access shared resources.
7866  Remarks:
7867  The parent directory to the "system" directory should be added to the
7868  compiler's search path for header files such that the following include
7869  statment will successfully include this file.
7870 
7871 #include "system/system.h"
7872  *******************************************************************************/
7873 //DOM-IGNORE-BEGIN
7874 /*******************************************************************************
7875 Copyright (c) 2011-2015 released Microchip Technology Inc. All rights reserved.
7876 Microchip licenses to you the right to use, modify, copy and distribute
7877 Software only when embedded on a Microchip microcontroller or digital signal
7878 controller that is integrated into your product or third party product
7879 (pursuant to the sublicense terms in the accompanying license agreement).
7880 You should refer to the license agreement accompanying this Software for
7881 additional information regarding your rights and obligations.
7882 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
7883 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7884 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7885 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7886 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7887 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7888 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7889 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7890 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7891 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7892  *******************************************************************************/
7893 //DOM-IGNORE-END
7894 #ifndef _SYSTEM_H
7895 #define _SYSTEM_H
7896 // *****************************************************************************
7897 // *****************************************************************************
7898 // Section: Included Files
7899 // *****************************************************************************
7900 // *****************************************************************************
7901 #include "system/common/sys_common.h"
7902 #include "system/common/sys_module.h"
7903 // DOM-IGNORE-BEGIN
7904 // DOM-IGNORE-END
7905 //DOM-IGNORE-BEGIN
7906 //DOM-IGNORE-END
7907  // _SYSTEM_H
7908 /*******************************************************************************
7909  End of File
7910 */
7911 #endif /*00 C:\microchip\harmony\v2_06\framework\system\system.h*/
7912 /* CLOSE_FILE Include File */
7913 
7914 #include "system/int/sys_int.h"
7915 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h */
7916 /*******************************************************************************
7917  DMA System Service Library Interface Definition
7918  Company:
7919  Microchip Technology Inc.
7920  File Name:
7921  sys_dma.h
7922  Summary:
7923  DMA System Service.
7924  Description:
7925  This file contains the interface definition for the DMA System
7926  Service. It provides a way to interact with the DMA subsystem to
7927  manage the data transfer between different peripherals and/or memory
7928  without intervention from the CPU.
7929 *******************************************************************************/
7930 //DOM-IGNORE-BEGIN
7931 /*******************************************************************************
7932 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
7933 Microchip licenses to you the right to use, modify, copy and distribute
7934 Software only when embedded on a Microchip microcontroller or digital signal
7935 controller that is integrated into your product or third party product
7936 (pursuant to the sublicense terms in the accompanying license agreement).
7937 You should refer to the license agreement accompanying this Software for
7938 additional information regarding your rights and obligations.
7939 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
7940 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7941 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7942 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7943 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7944 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7945 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7946 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7947 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7948 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7949 *******************************************************************************/
7950 //DOM-IGNORE-END
7951 #ifndef _SYS_DMA_H
7952 #define _SYS_DMA_H
7953 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h */
7954 /*******************************************************************************
7955  DMA System Service Library Interface Definition
7956  Company:
7957  Microchip Technology Inc.
7958  File Name:
7959  sys_dma_definitions.h
7960  Summary:
7961  DMA System Service data type definitions header.
7962  Description:
7963  This file contains data type definitions header.
7964 *******************************************************************************/
7965 //DOM-IGNORE-BEGIN
7966 /*******************************************************************************
7967 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
7968 Microchip licenses to you the right to use, modify, copy and distribute
7969 Software only when embedded on a Microchip microcontroller or digital signal
7970 controller that is integrated into your product or third party product
7971 (pursuant to the sublicense terms in the accompanying license agreement).
7972 You should refer to the license agreement accompanying this Software for
7973 additional information regarding your rights and obligations.
7974 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
7975 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7976 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7977 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7978 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7979 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7980 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7981 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7982 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7983 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7984 *******************************************************************************/
7985 //DOM-IGNORE-END
7986 #ifndef _SYS_DMA_DEFINITIONS_H
7987 #define _SYS_DMA_DEFINITIONS_H
7988 // *****************************************************************************
7989 // *****************************************************************************
7990 // Section: File includes
7991 // *****************************************************************************
7992 // *****************************************************************************
7993 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
7994 #include "system/common/sys_common.h"
7995 #include "system/common/sys_module.h"
7996 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h */
7997 /*******************************************************************************
7998  DMA Peripheral Library Interface Header
7999  Company:
8000  Microchip Technology Inc.
8001  File Name:
8002  plib_dma.h
8003  Summary:
8004  Defines the DMA Peripheral Library interface functions.
8005  Description:
8006  This header file contains the function prototypes and definitions of
8007  the data types and constants that make up the interface to the Direct Memory
8008  Access (DMA) Peripheral Library for Microchip microcontrollers. The
8009  definitions in this file are for the DMA module.
8010 *******************************************************************************/
8011 // DOM-IGNORE-BEGIN
8012 /*******************************************************************************
8013 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
8014 Microchip licenses to you the right to use, modify, copy and distribute
8015 Software only when embedded on a Microchip microcontroller or digital signal
8016 controller that is integrated into your product or third party product
8017 (pursuant to the sublicense terms in the accompanying license agreement).
8018 You should refer to the license agreement accompanying this Software for
8019 additional information regarding your rights and obligations.
8020 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
8021 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8022 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8023 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8024 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8025 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8026 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8027 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8028 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8029 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8030 *******************************************************************************/
8031 // DOM-IGNORE-END
8032 #ifndef _PLIB_DMA_H
8033 #define _PLIB_DMA_H
8034 // DOM-IGNORE-BEGIN
8035 // DOM-IGNORE-END
8036 // *****************************************************************************
8037 // *****************************************************************************
8038 // Section: Includes
8039 // *****************************************************************************
8040 // *****************************************************************************
8041 /* See Bottom of file for implementation header include files.
8042 */
8043 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h */
8044 //DOM-IGNORE-BEGIN
8045 /*******************************************************************************
8046 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
8047 Microchip licenses to you the right to use, modify, copy and distribute
8048 Software only when embedded on a Microchip microcontroller or digital signal
8049 controller that is integrated into your product or third party product
8050 (pursuant to the sublicense terms in the accompanying license agreement).
8051 You should refer to the license agreement accompanying this Software for
8052 additional information regarding your rights and obligations.
8053 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
8054 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8055 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8056 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8057 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8058 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8059 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8060 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8061 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8062 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8063  *******************************************************************************/
8064 //DOM-IGNORE-END
8065 #ifndef _PLIB_DMA_PROCESSOR_H
8066 #define _PLIB_DMA_PROCESSOR_H
8067 #error "Can't find header"
8068 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h*/
8069 /* CLOSE_FILE Include File */
8070 
8071 // *****************************************************************************
8072 // *****************************************************************************
8073 // Section: Peripheral Library Interface Functions
8074 // *****************************************************************************
8075 // *****************************************************************************
8076 // *****************************************************************************
8077 // *****************************************************************************
8078 // Section: DMA Channel Status Functions
8079 // *****************************************************************************
8080 // *****************************************************************************
8081 //******************************************************************************
8082 /* Function:
8083  bool PLIB_DMA_ChannelXBufferedDataIsWritten ( DMA_MODULE_ID index,
8084  DMA_CHANNEL channel )
8085  Summary:
8086  Returns the buffered data write status for the specified channel.
8087  Description:
8088  This function returns the buffered data write status for the specified channel.
8089  Precondition:
8090  None.
8091  Parameters:
8092  channel - One of the existing DMA channels listed by DMA_CHANNEL
8093  Returns:
8094  - true - The content of the DMA buffer has not been written to the location
8095  specified in the destination/source address or in Null Write mode
8096  - false - The content of the DMA buffer has been written to the location
8097  specified in the destination/source address or in Null Write mode
8098  Example:
8099  <code>
8100  bool chBuffWriteStatus;
8101  chBuffWriteStatus = PLIB_DMA_ChannelXBufferedDataIsWritten( DMA_ID_0,
8102  DMA_CHANNEL_3 );
8103  </code>
8104  Remarks:
8105  This feature is not available on all devices. Please refer to the specific device
8106  data sheet to determine availability.
8107 */
8108 
8109 bool
8111  DMA_MODULE_ID index ,
8112  DMA_CHANNEL channel ) ;
8113 /*******************************************************************************
8114  Function:
8115  bool PLIB_DMA_ChannelXCollisionStatus ( DMA_MODULE_ID index,
8116  DMA_CHANNEL channel,
8117  DMA_CHANNEL_COLLISION collisonType )
8118  Summary:
8119  Returns the status of the specified collision type for the specified channel.
8120  Description:
8121  This function returns the status of the specified collision type for the
8122  specified channel.
8123  Precondition:
8124  None.
8125  Parameters:
8126  channel - One of the existing DMA channels listed by DMA_CHANNEL
8127  collisonType - Collision type listed by DMA_CHANNEL_COLLISION
8128  Returns:
8129  - true - A collision specified by collisonType was detected
8130  - false - No collision of type collisonType was detected
8131  Example:
8132  <code>
8133  bool memWriteCollisionStatus;
8134  memWriteCollisionStatus = PLIB_DMA_ChannelXMemoryWriteCollisionStatus(
8135  DMA_ID_0,
8136  DMA_CHANNEL_3,
8137  DMA_CHANNEL_COLLISION_MEMORY );
8138  </code>
8139  Remarks:
8140  This feature is not available on all devices. Please refer to the specific
8141  device data sheet to determine availability.
8142 */
8143 
8144 bool
8146  DMA_MODULE_ID index ,
8147  DMA_CHANNEL channel ,
8148  DMA_CHANNEL_COLLISION collisonType ) ;
8149 //******************************************************************************
8150 /* Function:
8151  DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet( DMA_MODULE_ID index,
8152  DMA_CHANNEL channel )
8153  Summary:
8154  Returns the Ping-Pong mode status for the specified channel.
8155  Description:
8156  This function returns the Ping-Pong mode status for the specified channel.
8157  Precondition:
8158  None.
8159  Parameters:
8160  channel - One of the existing DMA channels listed by DMA_CHANNEL
8161  Returns:
8162  mode - One of the possible Ping-Pong modes
8163  Example:
8164  <code>
8165  DMA_PING_PONG_MODE chPingPongStatus;
8166  chPingPongStatus = PLIB_DMA_ChannelXPingPongModeGet(DMA_ID_0,
8167  DMA_CHANNEL_3 );
8168  if (DMA_PING_PONG_SECONDARY == chPingPongStatus)
8169  {
8170  \\Application
8171  }
8172  </code>
8173  Remarks:
8174  This feature is not available on all devices. Please refer to the specific
8175  device data sheet to determine availability.
8176 */
8177 
8178 DMA_PING_PONG_MODE
8180  DMA_MODULE_ID index ,
8181  DMA_CHANNEL channel ) ;
8182 //******************************************************************************
8183 /* Function:
8184  bool PLIB_DMA_ChannelXEventIsDetected ( DMA_MODULE_ID index,
8185  DMA_CHANNEL channel )
8186  Summary:
8187  Returns the event status on the specified channel.
8188  Description:
8189  This function returns the event status on the specified channel.
8190  Precondition:
8191  None.
8192  Parameters:
8193  channel - One of the possible DMA channels listed by DMA_CHANNEL
8194  Returns:
8195  - true - An event was detected
8196  - false - No events were detected
8197  Example:
8198  <code>
8199  bool channeleventStatus;
8200  channeleventStatus = PLIB_DMA_ChannelXEventIsDetected( DMA_ID_0,
8201  DMA_CHANNEL_2 );
8202  </code>
8203  Remarks:
8204  This function implements an operation of the ChannelXEvent feature.
8205  This feature may not be available on all devices. Please refer to the
8206  specific device data sheet to determine availability or include the
8207  PLIB_DMA_ExistsChannelXEvent function in your application to determine
8208  whether this feature is available.
8209 */
8210 
8211 bool
8213  DMA_MODULE_ID index ,
8214  DMA_CHANNEL channel ) ;
8215 // *****************************************************************************
8216 // *****************************************************************************
8217 // Section: DMA Channel Configuration Functions
8218 // *****************************************************************************
8219 // *****************************************************************************
8220 //******************************************************************************
8221 /* Function:
8222  void PLIB_DMA_ChannelXPrioritySelect ( DMA_MODULE_ID index,
8223  DMA_CHANNEL channel,
8224  DMA_CHANNEL_PRIORITY channelPriority )
8225  Summary:
8226  Sets the priority of the specified channel.
8227  Description:
8228  This function sets the priority of the specified channel.
8229  Precondition:
8230  None.
8231  Parameters:
8232  channel - One of the existing DMA channels listed by DMA_CHANNEL
8233  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8234  Returns:
8235  None.
8236  Example:
8237  <code>
8238  DMA_CHANNEL channel = DMA_CHANNEL_0;
8239  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_PRIORITY_3;
8240  PLIB_DMA_ChannelXPrioritySelect( DMA_ID_0, channel, channelPriority );
8241  </code>
8242  Remarks:
8243  This function implements an operation of the ChannelXPriority feature.
8244  This feature may not be available on all devices. Please refer to the
8245  specific device data sheet to determine availability or use the
8246  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8247  whether this feature is available.
8248 */
8249 
8250 void
8252  DMA_MODULE_ID index ,
8253  DMA_CHANNEL channel ,
8254  DMA_CHANNEL_PRIORITY channelPriority ) ;
8255 //******************************************************************************
8256 /* Function:
8257  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet ( DMA_MODULE_ID index,
8258  DMA_CHANNEL channel )
8259  Summary:
8260  Gets the priority of the specified channel.
8261  Description:
8262  This function gets the priority of the specified channel.
8263  Precondition:
8264  None.
8265  Parameters:
8266  channel - One of the existing DMA channels listed by DMA_CHANNEL
8267  Returns:
8268  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8269  Example:
8270  <code>
8271  DMA_CHANNEL channel = DMA_CHANNEL_0;
8272  DMA_CHANNEL_PRIORITY channelPriority;
8273  channelPriority = PLIB_DMA_ChannelXPriorityGet( DMA_ID_0, channel );
8274  </code>
8275  Remarks:
8276  This function implements an operation of the ChannelXPriority feature.
8277  This feature may not be available on all devices. Please refer to the
8278  specific device data sheet to determine availability or use the
8279  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8280  whether this feature is available.
8281 */
8282 
8283 DMA_CHANNEL_PRIORITY
8285  DMA_MODULE_ID index ,
8286  DMA_CHANNEL channel ) ;
8287 //******************************************************************************
8288 /* Function:
8289  void PLIB_DMA_ChannelPrioritySelect ( DMA_MODULE_ID index,
8290  DMA_CHANNEL_PRIORITY channelPriority )
8291  Summary:
8292  Sets the priority scheme of the DMA channels.
8293  Description:
8294  This function sets the priority scheme of the DMA channels at the global level.
8295  This function is used in devices that do not have the per channel priority feature.
8296  Precondition:
8297  None.
8298  Parameters:
8299  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8300  Returns:
8301  None.
8302  Example:
8303  <code>
8304  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_ROUND_ROBIN;
8305  PLIB_DMA_ChannelPrioritySelect( DMA_ID_0, channelPriority );
8306  </code>
8307  Remarks:
8308  This feature is not available on all devices. Please refer to the specific
8309  device data sheet to determine availability.
8310 */
8311 
8312 void
8314  DMA_MODULE_ID index ,
8315  DMA_CHANNEL_PRIORITY channelPriority ) ;
8316 //******************************************************************************
8317 /* Function:
8318  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet ( DMA_MODULE_ID index )
8319  Summary:
8320  Gets the priority scheme of the DMA channels.
8321  Description:
8322  This function gets the priority scheme of the DMA channels at the global level.
8323  This function is used in devices that do not have the per channel priority feature.
8324  Precondition:
8325  None.
8326  Parameters:
8327  None.
8328  Returns:
8329  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8330  Example:
8331  <code>
8332  DMA_CHANNEL_PRIORITY channelPriority;
8333  channelPriority = PLIB_DMA_ChannelPriorityGet( DMA_ID_0 );
8334  </code>
8335  Remarks:
8336  This feature is not available on all devices. Please refer to the specific
8337  device data sheet to determine availability.
8338 */
8339 
8340 DMA_CHANNEL_PRIORITY
8342  DMA_MODULE_ID index ) ;
8343 //******************************************************************************
8344 /* Function:
8345  void PLIB_DMA_ChannelXAutoEnable ( DMA_MODULE_ID index,
8346  DMA_CHANNEL channel )
8347  Summary:
8348  Channel is continuously enabled.
8349  Description:
8350  This function enables the channel continuously. The channel is not automatically
8351  disabled after a block transfer is complete.
8352  Precondition:
8353  None.
8354  Parameters:
8355  channel - One of the possible DMA channels listed by DMA_CHANNEL
8356  Returns:
8357  None.
8358  Example:
8359  <code>
8360  PLIB_DMA_ChannelXAutoEnable( DMA_ID_0, DMA_CHANNEL_2 );
8361  </code>
8362  Remarks:
8363  This function implements an operation of the ChannelXAuto feature.
8364  This feature may not be available on all devices. Please refer to the
8365  specific device data sheet to determine availability or use the
8366  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8367  whether this feature is available.
8368 */
8369 
8370 void
8372  DMA_MODULE_ID index ,
8373  DMA_CHANNEL channel ) ;
8374 //******************************************************************************
8375 /* Function:
8376  bool PLIB_DMA_ChannelXAutoIsEnabled ( DMA_MODULE_ID index,
8377  DMA_CHANNEL channel )
8378  Summary:
8379  Returns the channel automatic enable status.
8380  Description:
8381  This function returns the channel automatic enable status.
8382  Precondition:
8383  None.
8384  Parameters:
8385  channel - One of the possible DMA channels listed by DMA_CHANNEL
8386  Returns:
8387  - true - Channel automatic enable is on
8388  - false - Channel automatic enable is off
8389  Example:
8390  <code>
8391  bool ChAutoEnableStatus;
8392  ChAutoEnableStatus = PLIB_DMA_ChannelXAutoIsEnabled(DMA_ID_0, DMA_CHANNEL_2 );
8393  </code>
8394  Remarks:
8395  This function implements an operation of the ChannelXAuto feature.
8396  This feature may not be available on all devices. Please refer to the
8397  specific device data sheet to determine availability or use the
8398  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8399  whether this feature is available.
8400 */
8401 
8402 bool
8404  DMA_MODULE_ID index ,
8405  DMA_CHANNEL channel ) ;
8406 //******************************************************************************
8407 /* Function:
8408  void PLIB_DMA_ChannelXAutoDisable ( DMA_MODULE_ID index,
8409  DMA_CHANNEL channel )
8410  Summary:
8411  Channel is disabled after a block transfer is complete.
8412  Description:
8413  This function disables a channel after a block transfer is complete.
8414  Precondition:
8415  None.
8416  Parameters:
8417  channel - One of the possible DMA channels listed by DMA_CHANNEL
8418  Returns:
8419  None.
8420  Example:
8421  <code>
8422  PLIB_DMA_ChannelXAutoDisable( DMA_ID_0, DMA_CHANNEL_2 );
8423  </code>
8424  Remarks:
8425  This function implements an operation of the ChannelXAuto feature.
8426  This feature may not be available on all devices. Please refer to the
8427  specific device data sheet to determine availability or use the
8428  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8429  whether this feature is available.
8430 */
8431 
8432 void
8434  DMA_MODULE_ID index ,
8435  DMA_CHANNEL channel ) ;
8436 //******************************************************************************
8437 /* Function:
8438  void PLIB_DMA_ChannelXChainEnable ( DMA_MODULE_ID index,
8439  DMA_CHANNEL channel )
8440  Summary:
8441  Channel chain feature is enabled.
8442  Description:
8443  This function enables the channel chain feature.
8444  Precondition:
8445  None.
8446  Parameters:
8447  channel - One of the possible DMA channels listed by DMA_CHANNEL
8448  Returns:
8449  None.
8450  Example:
8451  <code>
8452  PLIB_DMA_ChannelXChainEnable( DMA_ID_0, DMA_CHANNEL_2 );
8453  </code>
8454  Remarks:
8455  This function implements an operation of the ChannelXChainEnbl feature.
8456  This feature may not be available on all devices. Please refer to the
8457  specific device data sheet to determine availability or use the
8458  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8459  whether this feature is available.
8460 */
8461 
8462 void
8464  DMA_MODULE_ID index ,
8465  DMA_CHANNEL channel ) ;
8466 //******************************************************************************
8467 /* Function:
8468  bool PLIB_DMA_ChannelXChainIsEnabled ( DMA_MODULE_ID index,
8469  DMA_CHANNEL channel )
8470  Summary:
8471  Returns the chain status of the specified channel.
8472  Description:
8473  This function returns the chain status of the specified channel.
8474  Precondition:
8475  None.
8476  Parameters:
8477  channel - One of the possible DMA channels listed by DMA_CHANNEL
8478  Returns:
8479  - true - The channel chain is on for this channel
8480  - false - The channel chain is off for this channel
8481  Example:
8482  <code>
8483  bool ChchainStatus;
8484  ChchainStatus = PLIB_DMA_ChannelXChainIsEnabled( DMA_ID_0, DMA_CHANNEL_2 );
8485  </code>
8486  Remarks:
8487  This function implements an operation of the ChannelXChainEnbl feature.
8488  This feature may not be available on all devices. Please refer to the
8489  specific device data sheet to determine availability or use the
8490  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8491  whether this feature is available.
8492 */
8493 
8494 bool
8496  DMA_MODULE_ID index ,
8497  DMA_CHANNEL channel ) ;
8498 //******************************************************************************
8499 /* Function:
8500  void PLIB_DMA_ChannelXChainDisable( DMA_MODULE_ID index,
8501  DMA_CHANNEL channel )
8502  Summary:
8503  Disables the channel chaining for the specified DMA channel.
8504  Description:
8505  This function disables the channel chaining for the specified DMA channel.
8506  Precondition:
8507  None.
8508  Parameters:
8509  channel - One of the possible DMA channels listed by DMA_CHANNEL
8510  Returns:
8511  None.
8512  Example:
8513  <code>
8514  PLIB_DMA_ChannelXChainDisable( DMA_ID_0, DMA_CHANNEL_2 );
8515  </code>
8516  Remarks:
8517  This function implements an operation of the ChannelXChainEnbl feature.
8518  This feature may not be available on all devices. Please refer to the
8519  specific device data sheet to determine availability or use the
8520  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8521  whether this feature is available.
8522 */
8523 
8524 void
8526  DMA_MODULE_ID index ,
8527  DMA_CHANNEL channel ) ;
8528 //******************************************************************************
8529 /* Function:
8530  void PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_MODULE_ID index,
8531  DMA_CHANNEL channel )
8532  Summary:
8533  Channel start/abort events will be registered even if the channel is
8534  disabled.
8535  Description:
8536  This function will allow the channel register start/abort events even if the
8537  channel is disabled.
8538  Precondition:
8539  None.
8540  Parameters:
8541  channel - One of the possible DMA channels listed by DMA_CHANNEL
8542  Returns:
8543  None.
8544  Example:
8545  <code>
8546  PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
8547  </code>
8548  Remarks:
8549  This function implements an operation of the ChannelXDisabled feature.
8550  This feature may not be available on all devices. Please refer to the
8551  specific device data sheet to determine availability or use the
8552  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
8553  determine whether this feature is available.
8554 */
8555 
8556 void
8558  DMA_MODULE_ID index ,
8559  DMA_CHANNEL channel ) ;
8560 //******************************************************************************
8561 /* Function:
8562  void PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_MODULE_ID index,
8563  DMA_CHANNEL channel )
8564  Summary:
8565  Channel start/abort events will be ignored even if the channel is
8566  disabled.
8567  Description:
8568  This function will allow the channel start/abort events to be ignored even if
8569  the channel is disabled.
8570  Precondition:
8571  None.
8572  Parameters:
8573  channel - One of the possible DMA channels listed by DMA_CHANNEL
8574  Returns:
8575  None.
8576  Example:
8577  <code>
8578  PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
8579  </code>
8580  Remarks:
8581  This function implements an operation of the ChannelXDisabled feature.
8582  This feature may not be available on all devices. Please refer to the
8583  specific device data sheet to determine availability or use the
8584  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
8585  determine whether this feature is available.
8586 */
8587 
8588 void
8590  DMA_MODULE_ID index ,
8591  DMA_CHANNEL channel ) ;
8592 //******************************************************************************
8593 /* Function:
8594  void PLIB_DMA_ChannelXEnable ( DMA_MODULE_ID index,
8595  DMA_CHANNEL channel )
8596  Summary:
8597  Enable the specified channel.
8598  Description:
8599  This function will enable the specified channel.
8600  Precondition:
8601  None.
8602  Parameters:
8603  channel - One of the possible DMA channels listed by DMA_CHANNEL
8604  Returns:
8605  None.
8606  Example:
8607  <code>
8608  PLIB_DMA_ChannelXEnable ( DMA_ID_0, DMA_CHANNEL_2 );
8609  </code>
8610  Remarks:
8611  This function implements an operation of the ChannelX feature.
8612  This feature may not be available on all devices. Please refer to the
8613  specific device data sheet to determine availability or use the
8614  PLIB_DMA_ExistsChannelX function in your application to automatically
8615  determine whether this feature is available.
8616 */
8617 
8618 void
8620  DMA_MODULE_ID index ,
8621  DMA_CHANNEL channel ) ;
8622 //******************************************************************************
8623 /* Function:
8624  bool PLIB_DMA_ChannelXIsEnabled ( DMA_MODULE_ID index,
8625  DMA_CHANNEL channel )
8626  Summary:
8627  Return the enable status of the specified channel.
8628  Description:
8629  This function will return the enable status of the specified channel.
8630  Precondition:
8631  None.
8632  Parameters:
8633  channel - One of the possible DMA channels listed by DMA_CHANNEL
8634  Returns:
8635  - true - The specified DMA channel is enabled
8636  - false - The specified DMA channel is disabled
8637  Example:
8638  <code>
8639  bool chEnableStatus;
8640  chEnableStatus = PLIB_DMA_ChannelXIsEnabled ( DMA_ID_0, DMA_CHANNEL_2 );
8641  </code>
8642  Remarks:
8643  This function implements an operation of the ChannelX feature.
8644  This feature may not be available on all devices. Please refer to the
8645  specific device data sheet to determine availability or use the
8646  PLIB_DMA_ExistsChannelX function in your application to automatically
8647  determine whether this feature is available.
8648 */
8649 
8650 bool
8652  DMA_MODULE_ID index ,
8653  DMA_CHANNEL channel ) ;
8654 //******************************************************************************
8655 /* Function:
8656  void PLIB_DMA_ChannelXDisable ( DMA_MODULE_ID index,
8657  DMA_CHANNEL channel )
8658  Summary:
8659  Disable the specified channel.
8660  Description:
8661  This function will disable the specified channel.
8662  Precondition:
8663  None.
8664  Parameters:
8665  channel - One of the possible DMA channels listed by DMA_CHANNEL
8666  Returns:
8667  None.
8668  Example:
8669  <code>
8670  PLIB_DMA_ChannelXDisable ( DMA_ID_0, DMA_CHANNEL_2 );
8671  </code>
8672  Remarks:
8673  This function implements an operation of the ChannelX feature.
8674  This feature may not be available on all devices. Please refer to the
8675  specific device data sheet to determine availability or use the
8676  PLIB_DMA_ExistsChannelX function in your application to automatically
8677  determine whether this feature is available.
8678 */
8679 
8680 void
8682  DMA_MODULE_ID index ,
8683  DMA_CHANNEL channel ) ;
8684 //******************************************************************************
8685 /* Function:
8686  void PLIB_DMA_ChannelXChainToLower( DMA_MODULE_ID index,
8687  DMA_CHANNEL channel )
8688  Summary:
8689  Chains the specified channel to a channel lower in natural priority.
8690  Description:
8691  This function will chain the specified channel to a channel lower in
8692  natural priority. CH3 will be enabled by a CH4 transfer complete.
8693  Precondition:
8694  None.
8695  Parameters:
8696  channel - One of the possible DMA channels listed by DMA_CHANNEL
8697  Returns:
8698  None.
8699  Example:
8700  <code>
8701  PLIB_DMA_ChannelXChainToLower ( DMA_ID_0, DMA_CHANNEL_4 );
8702  </code>
8703  Remarks:
8704  This function implements an operation of the ChannelXChain feature.
8705  This feature may not be available on all devices. Please refer to the
8706  specific device data sheet to determine availability or use the
8707  PLIB_DMA_ExistsChannelXChain function in your application to automatically
8708  determine whether this feature is available.
8709 */
8710 
8711 void
8713  DMA_MODULE_ID index ,
8714  DMA_CHANNEL channel ) ;
8715 //******************************************************************************
8716 /* Function:
8717  void PLIB_DMA_ChannelXChainToHigher ( DMA_MODULE_ID index,
8718  DMA_CHANNEL channel )
8719  Summary:
8720  Chains the specified channel to a channel higher in natural priority.
8721  Description:
8722  This function will chain the specified channel to a channel higher in
8723  natural priority. CH5 will be enabled by a CH4 transfer complete.
8724  Precondition:
8725  None.
8726  Parameters:
8727  channel - One of the possible DMA channels listed by DMA_CHANNEL
8728  Returns:
8729  None.
8730  Example:
8731  <code>
8732  PLIB_DMA_ChannelXChainToHigher ( DMA_ID_0, DMA_CHANNEL_4 );
8733  </code>
8734  Remarks:
8735  This function implements an operation of the ChannelXChain feature.
8736  This feature may not be available on all devices. Please refer to the
8737  specific device data sheet to determine availability or use the
8738  PLIB_DMA_ExistsChannelXChain function in your application to automatically
8739  determine whether this feature is available.
8740 */
8741 
8742 void
8744  DMA_MODULE_ID index ,
8745  DMA_CHANNEL channel ) ;
8746 //******************************************************************************
8747 /* Function:
8748  void PLIB_DMA_ChannelXBusyActiveSet ( DMA_MODULE_ID index,
8749  DMA_CHANNEL channel )
8750  Summary:
8751  Sets the Busy bit to active.
8752  Description:
8753  This function sets the Busy bit to active, indicating the channel is active
8754  or has been enabled.
8755  Precondition:
8756  None.
8757  Parameters:
8758  channel - One of the possible DMA channels listed by DMA_CHANNEL
8759  Returns:
8760  None.
8761  Example:
8762  <code>
8763  PLIB_DMA_ChannelXBusyActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
8764  </code>
8765  Remarks:
8766  This function implements an operation of the ChannelXBusy feature.
8767  This feature may not be available on all devices. Please refer to the
8768  specific device data sheet to determine availability or use the
8769  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8770  determine whether this feature is available.
8771 */
8772 
8773 void
8775  DMA_MODULE_ID index ,
8776  DMA_CHANNEL channel ) ;
8777 //******************************************************************************
8778 /* Function:
8779  void PLIB_DMA_ChannelXBusyInActiveSet ( DMA_MODULE_ID index,
8780  DMA_CHANNEL channel )
8781  Summary:
8782  Sets the Busy bit to inactive.
8783  Description:
8784  This function sets the Busy bit to inactive, indicating the channel is inactive
8785  or has been disabled.
8786  Precondition:
8787  None.
8788  Parameters:
8789  channel - One of the possible DMA channels listed by DMA_CHANNEL
8790  Returns:
8791  None.
8792  Example:
8793  <code>
8794  PLIB_DMA_ChannelXBusyInActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
8795  </code>
8796  Remarks:
8797  This function implements an operation of the ChannelXBusy feature.
8798  This feature may not be available on all devices. Please refer to the
8799  specific device data sheet to determine availability or use the
8800  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8801  determine whether this feature is available.
8802 */
8803 
8804 void
8806  DMA_MODULE_ID index ,
8807  DMA_CHANNEL channel ) ;
8808 //******************************************************************************
8809 /* Function:
8810  bool PLIB_DMA_ChannelXBusyIsBusy ( DMA_MODULE_ID index,
8811  DMA_CHANNEL channel )
8812  Summary:
8813  Returns the busy status of the specified channel.
8814  Description:
8815  This function returns the busy status of the specified channel.
8816  Precondition:
8817  None.
8818  Parameters:
8819  channel - One of the possible DMA channels listed by DMA_CHANNEL
8820  Returns:
8821  - true - The channel is active or has been enabled
8822  - false - The channel is inactive or has been disabled
8823  Example:
8824  <code>
8825  bool chBusyStatus;
8826  chBusyStatus = PLIB_DMA_ChannelXBusyIsBusy ( DMA_ID_0, DMA_CHANNEL_4 );
8827  </code>
8828  Remarks:
8829  This function implements an operation of the ChannelXBusy feature.
8830  This feature may not be available on all devices. Please refer to the
8831  specific device data sheet to determine availability or use the
8832  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8833  determine whether this feature is available.
8834 */
8835 
8836 bool
8838  DMA_MODULE_ID index ,
8839  DMA_CHANNEL channel ) ;
8840 //******************************************************************************
8841 /* Function:
8842  void PLIB_DMA_ChannelXTransferDirectionSelect ( DMA_MODULE_ID index,
8843  DMA_CHANNEL channel,
8844  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection )
8845  Summary:
8846  Selects the data transfer direction of the specified channel.
8847  Description:
8848  This function selects the data transfer direction of the specified channel.
8849  Precondition:
8850  None.
8851  Parameters:
8852  channel - One of the possible DMA channels listed by DMA_CHANNEL
8853  chTransferDirection - The transfer direction indicated by DMA_CHANNEL_TRANSFER_DIRECTION
8854  Returns:
8855  None.
8856  Example:
8857  <code>
8858  PLIB_DMA_ChannelXTransferDirectionSelect (
8859  DMA_ID_0,
8860  DMA_CHANNEL_4,
8861  DMA_READ_FROM_MEMORY_WRITE_TO_PERIPHERAL );
8862  </code>
8863  Remarks:
8864  This feature is not available on all devices. Please refer to the specific
8865  device data sheet to determine availability.
8866 */
8867 
8868 void
8870  DMA_MODULE_ID index ,
8871  DMA_CHANNEL channel ,
8872  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection ) ;
8873 //******************************************************************************
8874 /* Function:
8875  DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet (
8876  DMA_MODULE_ID index,
8877  DMA_CHANNEL channel)
8878  Summary:
8879  Returns the data transfer direction of the specified channel.
8880  Description:
8881  This function returns the data transfer direction of the specified channel.
8882  Precondition:
8883  None.
8884  Parameters:
8885  channel - One of the possible DMA channels listed by DMA_CHANNEL
8886  Returns:
8887  - DMA_CHANNEL_TRANSFER_DIRECTION - The transfer direction indicated by the
8888  DMA_CHANNEL_TRANSFER_DIRECTION
8889  Example:
8890  <code>
8891  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection;
8892  chTransferDirection = PLIB_DMA_ChannelXTransferDirectionGet (
8893  DMA_ID_0,
8894  DMA_CHANNEL_4 );
8895  </code>
8896  Remarks:
8897  This feature is not available on all devices. Please refer to the specific
8898  device data sheet to determine availability.
8899 */
8900 
8901 DMA_CHANNEL_TRANSFER_DIRECTION
8903  DMA_MODULE_ID index ,
8904  DMA_CHANNEL channel ) ;
8905 //******************************************************************************
8906 /* Function:
8907  void PLIB_DMA_ChannelXStartAddressOffsetSet( DMA_MODULE_ID index,
8908  DMA_CHANNEL channel ,
8909  uint16_t address,
8910  DMA_ADDRESS_OFFSET_TYPE offset )
8911  Summary:
8912  Sets the primary/secondary start address (DPSRAM) offset to the value
8913  specified depending on the offset type specified for the specified channel.
8914  Description:
8915  This function sets the primary/secondary start address (DPSRAM) offset to the value
8916  specified depending on the offset type specified for the specified channel.
8917  Precondition:
8918  None.
8919  Parameters:
8920  channel - One of the possible DMA channels listed by DMA_CHANNEL
8921  address - The primary/secondary DPSRAM start address offset
8922  offset - The type of the address offset (primary/secondary)
8923  Returns:
8924  None.
8925  Example:
8926  <code>
8927  uint16_t address = 0x100;
8928  PLIB_DMA_ChannelXStartAddressOffsetSet ( DMA_ID_0,
8929  DMA_CHANNEL_4,
8930  address,
8931  DMA_ADDRESS_OFFSET_PRIMARY );
8932  </code>
8933  Remarks:
8934  This feature is not available on all devices. Please refer to the specific
8935  device data sheet to determine availability.
8936 */
8937 
8938 void
8940  DMA_MODULE_ID index ,
8941  DMA_CHANNEL channel ,
8942  uint16_t address ,
8943  DMA_ADDRESS_OFFSET_TYPE offset ) ;
8944 //******************************************************************************
8945 /* Function:
8946  uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet ( DMA_MODULE_ID index,
8947  DMA_CHANNEL channel,
8948  DMA_ADDRESS_OFFSET_TYPE offset)
8949  Summary:
8950  Gets the primary/secondary start address (DPSRAM) offset.
8951  Description:
8952  This function gets the primary/secondary start address (DPSRAM) offset.
8953  Precondition:
8954  None.
8955  Parameters:
8956  channel - One of the possible DMA channels listed by DMA_CHANNEL
8957  offset - The type of the address offset (primary/secondary)
8958  Returns:
8959  - uint16_t - The primary/secondary DPSRAM start address offset
8960  Example:
8961  <code>
8962  uint16_t addressOffsetA;
8963  addressOffsetA = PLIB_DMA_ChannelXStartAddressOffsetGet (
8964  DMA_ID_0,
8965  DMA_CHANNEL_4,
8966  address,
8967  DMA_ADDRESS_OFFSET_PRIMARY );
8968  </code>
8969  Remarks:
8970  This feature is not available on all devices. Please refer to the specific
8971  device data sheet to determine availability.
8972 */
8973 
8974 uint16_t
8976  DMA_MODULE_ID index ,
8977  DMA_CHANNEL channel ,
8978  DMA_ADDRESS_OFFSET_TYPE offset ) ;
8979 //******************************************************************************
8980 /* Function:
8981  void PLIB_DMA_ChannelXPeripheralAddressSet( DMA_MODULE_ID index,
8982  DMA_CHANNEL channel ,
8983  uint16_t peripheraladdress )
8984  Summary:
8985  Sets the peripheral address for the specified channel.
8986  Description:
8987  This function sets the peripheral address for the specified channel.
8988  Precondition:
8989  None.
8990  Parameters:
8991  channel - One of the possible DMA channels listed by DMA_CHANNEL
8992  peripheraladdress - The peripheral address for the specified channel
8993  Returns:
8994  None.
8995  Example:
8996  <code>
8997  uint16_t peripheraladdress = 0x100;
8998  PLIB_DMA_ChannelXPeripheralAddressSet ( DMA_ID_0,
8999  DMA_CHANNEL_4,
9000  peripheraladdress );
9001  </code>
9002  Remarks:
9003  This feature is not available on all devices. Please refer to the specific
9004  device data sheet to determine availability.
9005 */
9006 
9007 void
9009  DMA_MODULE_ID index ,
9010  DMA_CHANNEL channel ,
9011  uint16_t peripheraladdress ) ;
9012 //******************************************************************************
9013 /* Function:
9014  uint16_t PLIB_DMA_ChannelXPeripheralAddressGet( DMA_MODULE_ID index,
9015  DMA_CHANNEL channel )
9016  Summary:
9017  Gets the peripheral address configured for the specified channel.
9018  Description:
9019  This function gets the peripheral address configured for the specified channel.
9020  Precondition:
9021  None.
9022  Parameters:
9023  channel - One of the possible DMA channels listed by DMA_CHANNEL
9024  Returns:
9025  - uint16_t - The peripheral address configured for the specified channel
9026  Example:
9027  <code>
9028  uint16_t peripheraladdress;
9029  peripheraladdress = PLIB_DMA_ChannelXPeripheralAddressGet ( DMA_ID_0,
9030  DMA_CHANNEL_4 );
9031  </code>
9032  Remarks:
9033  This feature is not available on all devices. Please refer to the specific
9034  device data sheet to determine availability.
9035 */
9036 
9037 uint16_t
9039  DMA_MODULE_ID index ,
9040  DMA_CHANNEL channel ) ;
9041 //******************************************************************************
9042 /* Function:
9043  void PLIB_DMA_ChannelXTransferCountSet( DMA_MODULE_ID index,
9044  DMA_CHANNEL channel ,
9045  uint16_t transferCount )
9046  Summary:
9047  Sets the DMA data transfer count for the specified channel.
9048  Description:
9049  This function sets the DMA data transfer count for the specified channel.
9050  Precondition:
9051  None.
9052  Parameters:
9053  channel - One of the possible DMA channels listed by DMA_CHANNEL
9054  transferCount - The DMA transfer count for the channel
9055  Returns:
9056  None.
9057  Example:
9058  <code>
9059  uint16_t transferCount = 0x10;
9060  PLIB_DMA_ChannelXTransferCountSet ( DMA_ID_0,
9061  DMA_CHANNEL_4,
9062  transferCount );
9063  </code>
9064  Remarks:
9065  This feature is not available on all devices. Please refer to the specific
9066  device data sheet to determine availability.
9067 */
9068 
9069 void
9071  DMA_MODULE_ID index ,
9072  DMA_CHANNEL channel ,
9073  uint16_t transferCount ) ;
9074 //******************************************************************************
9075 /* Function:
9076  uint16_t PLIB_DMA_ChannelXTransferCountGet( DMA_MODULE_ID index,
9077  DMA_CHANNEL channel )
9078  Summary:
9079  Gets the DMA data transfer count that is programmed for the specified channel.
9080  Description:
9081  This function gets the DMA data transfer count that is programmed for the specified channel.
9082  Precondition:
9083  None.
9084  Parameters:
9085  channel - One of the possible DMA channels listed by DMA_CHANNEL
9086  Returns:
9087  - uint16_t - The DMA transfer count for the channel
9088  Example:
9089  <code>
9090  uint16_t transferCount;
9091  transferCount = PLIB_DMA_ChannelXTransferCountGet ( DMA_ID_0,
9092  DMA_CHANNEL_4 );
9093  </code>
9094  Remarks:
9095  This feature is not available on all devices. Please refer to the specific
9096  device data sheet to determine availability.
9097 */
9098 
9099 uint16_t
9101  DMA_MODULE_ID index ,
9102  DMA_CHANNEL channel ) ;
9103 //******************************************************************************
9104 /* Function:
9105  void PLIB_DMA_ChannelXSourceAddressModeSelect (
9106  DMA_MODULE_ID index,
9107  DMA_CHANNEL channel,
9108  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode )
9109  Summary:
9110  Sets the source address mode of the specified channel.
9111  Description:
9112  This function sets the source address mode of the specified channel.
9113  Precondition:
9114  None.
9115  Parameters:
9116  channel - One of the possible DMA channels listed by DMA_CHANNEL
9117  sourceAddressMode - One of the possible source addressing modes listed by
9118  DMA_SOURCE_ADDRESSING_MODE
9119  Returns:
9120  None.
9121  Example:
9122  <code>
9123  PLIB_DMA_ChannelXSourceAddressModeSelect (
9124  DMA_ID_0,
9125  DMA_CHANNEL_4,
9126  DMA_ADDRESSING_SOURCE_INCREMENT_BASED_ON_SIZE );
9127  </code>
9128  Remarks:
9129  This feature is not available on all devices. Please refer to the specific
9130  device data sheet to determine availability.
9131 */
9132 
9133 void
9135  DMA_MODULE_ID index ,
9136  DMA_CHANNEL channel ,
9137  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode ) ;
9138 //******************************************************************************
9139 /* Function:
9140  DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet (
9141  DMA_MODULE_ID index,
9142  DMA_CHANNEL channel )
9143  Summary:
9144  Gets the source address mode of the specified channel.
9145  Description:
9146  This function gets the source address mode of the specified channel.
9147  Precondition:
9148  None.
9149  Parameters:
9150  channel - One of the possible DMA channels listed by DMA_CHANNEL
9151  Returns:
9152  - DMA_SOURCE_ADDRESSING_MODE - One of the possible source addressing modes
9153  listed by DMA_SOURCE_ADDRESSING_MODE
9154  Example:
9155  <code>
9156  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode;
9157  sourceAddressMode = PLIB_DMA_ChannelXSourceAddressModeGet ( DMA_ID_0,
9158  DMA_CHANNEL_4 );
9159  </code>
9160  Remarks:
9161  This feature is not available on all devices. Please refer to the specific
9162  device data sheet to determine availability.
9163 */
9164 
9165 DMA_SOURCE_ADDRESSING_MODE
9167  DMA_MODULE_ID index ,
9168  DMA_CHANNEL channel ) ;
9169 //******************************************************************************
9170 /* Function:
9171  void PLIB_DMA_ChannelXDestinationAddressModeSelect (
9172  DMA_MODULE_ID index,
9173  DMA_CHANNEL channel,
9174  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode )
9175  Summary:
9176  Sets the source address mode of the specified channel.
9177  Description:
9178  This function Sets the source address mode of the specified channel.
9179  Precondition:
9180  None.
9181  Parameters:
9182  channel - One of the possible DMA channels listed by DMA_CHANNEL
9183  destinationAddressMode - One of the possible source addressing modes listed by
9184  DMA_DESTINATION_ADDRESSING_MODE
9185  Returns:
9186  None.
9187  Example:
9188  <code>
9189  PLIB_DMA_ChannelXDestinationAddressModeSelect (
9190  DMA_ID_0,
9191  DMA_CHANNEL_4,
9192  DMA_ADDRESSING_DESTINATION_INCREMENT_BASED_ON_SIZE );
9193  </code>
9194  Remarks:
9195  This feature is not available on all devices. Please refer to the specific
9196  device data sheet to determine availability.
9197 */
9198 
9199 void
9201  DMA_MODULE_ID index ,
9202  DMA_CHANNEL channel ,
9203  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode ) ;
9204 //******************************************************************************
9205 /* Function:
9206  DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet (
9207  DMA_MODULE_ID index,
9208  DMA_CHANNEL channel )
9209  Summary:
9210  Gets the source address mode of the specified channel.
9211  Description:
9212  This function gets the source address mode of the specified channel.
9213  Precondition:
9214  None.
9215  Parameters:
9216  channel - One of the possible DMA channels listed by DMA_CHANNEL
9217  Returns:
9218  - destinationAddressMode - One of the possible source addressing modes listed by
9219  DMA_DESTINATION_ADDRESSING_MODE
9220  Example:
9221  <code>
9222  DMA_SOURCE_ADDRESSING_MODE destinationAddressMode;
9223  destinationAddressMode = PLIB_DMA_ChannelXDestinationAddressModeGet (
9224  DMA_ID_0,
9225  DMA_CHANNEL_4 );
9226  </code>
9227  Remarks:
9228  This feature is not available on all devices. Please refer to the specific
9229  device data sheet to determine availability.
9230 */
9231 
9232 DMA_DESTINATION_ADDRESSING_MODE
9234  DMA_MODULE_ID index ,
9235  DMA_CHANNEL channel ) ;
9236 //******************************************************************************
9237 /* Function:
9238  void PLIB_DMA_ChannelXAddressModeSelect (
9239  DMA_MODULE_ID index,
9240  DMA_CHANNEL channel,
9241  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode )
9242  Summary:
9243  Sets the channel address mode.
9244  Description:
9245  This function sets the channel address mode.
9246  Precondition:
9247  None.
9248  Parameters:
9249  channel - One of the possible DMA channels listed by DMA_CHANNEL
9250  channelAddressMode - One of the possible channel addressing modes listed by
9251  DMA_CHANNEL_ADDRESSING_MODE
9252  Returns:
9253  None.
9254  Example:
9255  <code>
9256  PLIB_DMA_ChannelXAddressModeSelect (
9257  DMA_ID_0,
9258  DMA_CHANNEL_4,
9259  DMA_ADDRESSING_REGISTER_INDIRECT_WITH_POST_INCREMENT );
9260  </code>
9261  Remarks:
9262  This feature is not available on all devices. Please refer to the specific
9263  device data sheet to determine availability.
9264 */
9265 
9266 void
9268  DMA_MODULE_ID index ,
9269  DMA_CHANNEL channel ,
9270  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode ) ;
9271 //******************************************************************************
9272 /* Function:
9273  DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet (
9274  DMA_MODULE_ID index,
9275  DMA_CHANNEL channel )
9276  Summary:
9277  Gets the channel address mode.
9278  Description:
9279  This function gets the channel address mode.
9280  Precondition:
9281  None.
9282  Parameters:
9283  channel - One of the possible DMA channels listed by DMA_CHANNEL
9284  Returns:
9285  - channelAddressMode - One of the possible source addressing modes listed by
9286  DMA_CHANNEL_ADDRESSING_MODE
9287  Example:
9288  <code>
9289  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode;
9290  channelAddressMode = PLIB_DMA_ChannelXAddressModeGet ( DMA_ID_0,
9291  DMA_CHANNEL_4 );
9292  </code>
9293  Remarks:
9294  This feature is not available on all devices. Please refer to the specific
9295  device data sheet to determine availability.
9296 */
9297 
9298 DMA_CHANNEL_ADDRESSING_MODE
9300  DMA_MODULE_ID index ,
9301  DMA_CHANNEL channel ) ;
9302 // *****************************************************************************
9303 // *****************************************************************************
9304 // Section: DMA Channel Event Configuration functions
9305 // *****************************************************************************
9306 // *****************************************************************************
9307 //******************************************************************************
9308 /* Function:
9309  void PLIB_DMA_ChannelXTriggerEnable ( DMA_MODULE_ID index,
9310  DMA_CHANNEL channel,
9311  DMA_CHANNEL_TRIGGER_TYPE trigger )
9312  Summary:
9313  Enables the specified DMA channel trigger.
9314  Description:
9315  This function enables the specified DMA channel trigger.
9316  Precondition:
9317  None.
9318  Parameters:
9319  channel - One of the possible DMA channels listed by DMA_CHANNEL
9320  trigger - Type of trigger (transfer start/abort/pattern match abort)
9321  Returns:
9322  None.
9323  Example:
9324  <code>
9325  PLIB_DMA_ChannelXTriggerEnable ( DMA_ID_0,
9326  DMA_CHANNEL_4,
9327  DMA_CHANNEL_TRIGGER_TRANSFER_ABORT );
9328  </code>
9329  Remarks:
9330  This function implements an operation of the ChannelXTrigger feature.
9331  This feature may not be available on all devices. Please refer to the
9332  specific device data sheet to determine availability or use the
9333  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9334  determine whether this feature is available.
9335 */
9336 
9337 void
9339  DMA_MODULE_ID index ,
9340  DMA_CHANNEL channel ,
9341  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9342 //******************************************************************************
9343 /* Function:
9344  bool PLIB_DMA_ChannelXTriggerIsEnabled( DMA_MODULE_ID index,
9345  DMA_CHANNEL channel,
9346  DMA_CHANNEL_TRIGGER_TYPE trigger )
9347  Summary:
9348  Returns the enable status of the specified DMA transfer/abort trigger.
9349  Description:
9350  This function returns the enable status of the specified DMA transfer/abort trigger.
9351  Precondition:
9352  None.
9353  Parameters:
9354  channel - One of the possible DMA channels listed by DMA_CHANNEL
9355  trigger - Type of trigger (transfer start/abort/pattern match abort)
9356  Returns:
9357  - true - The specified trigger is enabled
9358  - false - The specified trigger is disabled
9359  Example:
9360  <code>
9361  bool startTriggerstatus;
9362  startTriggerstatus = PLIB_DMA_ChannelXTriggerIsEnabled (
9363  DMA_ID_0,
9364  DMA_CHANNEL_4,
9365  DMA_CHANNEL_TRIGGER_TRANSFER_START );
9366  </code>
9367  Remarks:
9368  This function implements an operation of the ChannelXTrigger feature.
9369  This feature may not be available on all devices. Please refer to the
9370  specific device data sheet to determine availability or use the
9371  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9372  determine whether this feature is available.
9373 */
9374 
9375 bool
9377  DMA_MODULE_ID index ,
9378  DMA_CHANNEL channel ,
9379  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9380 //******************************************************************************
9381 /* Function:
9382  void PLIB_DMA_ChannelXTriggerDisable ( DMA_MODULE_ID index,
9383  DMA_CHANNEL channel,
9384  DMA_CHANNEL_TRIGGER_TYPE trigger )
9385  Summary:
9386  Disables the DMA transfer abort via a matching interrupt (specified by the IRQ).
9387  Description:
9388  This function disables the DMA transfer abort via a matching interrupt
9389  (specified by the IRQ). The interrupt number IRQ is ignored and does not terminate
9390  a transfer.
9391  Precondition:
9392  None.
9393  Parameters:
9394  channel - One of the possible DMA channels listed by DMA_CHANNEL
9395  trigger - Type of trigger (transfer start/abort/pattern match abort)
9396  Returns:
9397  None.
9398  Example:
9399  <code>
9400  PLIB_DMA_ChannelXTriggerDisable ( DMA_ID_0,
9401  DMA_CHANNEL_4,
9402  DMA_CHANNEL_TRIGGER_PATTERN_MATCH_ABORT );
9403  </code>
9404  Remarks:
9405  This function implements an operation of the ChannelXTrigger feature.
9406  This feature may not be available on all devices. Please refer to the
9407  specific device data sheet to determine availability or use the
9408  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9409  determine whether this feature is available.
9410 */
9411 
9412 void
9414  DMA_MODULE_ID index ,
9415  DMA_CHANNEL channel ,
9416  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9417 //******************************************************************************
9418 /* Function:
9419  void PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_MODULE_ID index,
9420  DMA_CHANNEL channel)
9421  Summary:
9422  Gets the source number for the DMA channel interrupts.
9423  Description:
9424  This function returns the interrupt source number for the specified
9425  DMA channel.
9426  Precondition:
9427  None.
9428  Parameters:
9429  channel - One of the possible DMA channels listed by DMA_CHANNEL
9430  Returns:
9431  None.
9432  Example:
9433  <code>
9434  PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_ID_0,
9435  DMA_CHANNEL_4);
9436  </code>
9437  Remarks:
9438  This function implements an operation of the ChannelXTrigger feature.
9439  This feature may not be available on all devices. Please refer to the
9440  specific device data sheet to determine availability or use the
9441  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9442  determine whether this feature is available.
9443 */
9444 
9445 DMA_CHANNEL_INT_SOURCE
9447  DMA_MODULE_ID index ,
9448  DMA_CHANNEL channel ) ;
9449 //******************************************************************************
9450 /* Function:
9451  void PLIB_DMA_ChannelXStartIRQSet ( DMA_MODULE_ID index,
9452  DMA_CHANNEL channel,
9453  DMA_TRIGGER_SOURCE IRQnum )
9454  Summary:
9455  Sets the IRQ to initiate the DMA transfer on the specified channel.
9456  Description:
9457  This function sets the IRQ to initiate the DMA transfer on the specified channel.
9458  (IRQ to start the channel transfer.)
9459  Precondition:
9460  None.
9461  Parameters:
9462  channel - One of the possible DMA channels listed by DMA_CHANNEL
9463  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9464  Returns:
9465  None.
9466  Example:
9467  <code>
9468  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_OUTPUT_COMPARE_1;
9469  PLIB_DMA_ChannelXStartIRQSet ( DMA_ID_0,
9470  DMA_CHANNEL_4,
9471  irq );
9472  </code>
9473  Remarks:
9474  This function implements an operation of the ChannelXStartIRQ feature.
9475  This feature may not be available on all devices. Please refer to the
9476  specific device data sheet to determine availability or use the
9477  PLIB_DMA_ExistsChannelXStartIRQ function in your application to automatically
9478  determine whether this feature is available.
9479 */
9480 
9481 void
9483  DMA_MODULE_ID index ,
9484  DMA_CHANNEL channel ,
9485  DMA_TRIGGER_SOURCE IRQnum ) ;
9486 //******************************************************************************
9487 /* Function:
9488  void PLIB_DMA_ChannelXAbortIRQSet ( DMA_MODULE_ID index,
9489  DMA_CHANNEL channel,
9490  DMA_TRIGGER_SOURCE IRQ )
9491  Summary:
9492  Sets the IRQ to abort the DMA transfer on the specified channel.
9493  Description:
9494  This function sets the IRQ to abort the DMA transfer on the specified channel.
9495  (IRQ to start the channel transfer.)
9496  Precondition:
9497  None.
9498  Parameters:
9499  channel - One of the possible DMA channels listed by DMA_CHANNEL
9500  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9501  Returns:
9502  None.
9503  Example:
9504  <code>
9505  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_TIMER_CORE;
9506  PLIB_DMA_ChannelXAbortIRQSet ( DMA_ID_0,
9507  DMA_CHANNEL_4,
9508  irq );
9509  </code>
9510  Remarks:
9511  This function implements an operation of the ChannelXAbortIRQ feature.
9512  This feature may not be available on all devices. Please refer to the
9513  specific device data sheet to determine availability or use the
9514  PLIB_DMA_ExistsChannelXAbortIRQ function in your application to automatically
9515  determine whether this feature is available.
9516 */
9517 
9518 void
9520  DMA_MODULE_ID index ,
9521  DMA_CHANNEL channel ,
9522  DMA_TRIGGER_SOURCE IRQ ) ;
9523 //******************************************************************************
9524 /* Function:
9525  void PLIB_DMA_ChannelXDataSizeSelect ( DMA_MODULE_ID index,
9526  DMA_CHANNEL channel,
9527  DMA_CHANNEL_DATA_SIZE channelDataSize )
9528  Summary:
9529  Selects the data size for the specified channel.
9530  Description:
9531  This function selects the data size for the specified channel.
9532  Precondition:
9533  None.
9534  Parameters:
9535  channel - One of the possible DMA channels listed by DMA_CHANNEL
9536  channelDataSize - One of the possible data sizes listed by DMA_CHANNEL_DATA_SIZE
9537  Returns:
9538  None.
9539  Example:
9540  <code>
9541  DMA_CHANNEL_DATA_SIZE channelDataSize = DMA_CHANNEL_DATA_8;
9542  PLIB_DMA_ChannelXDataSizeSelect ( DMA_ID_0,
9543  DMA_CHANNEL_4,
9544  channelDataSize );
9545  </code>
9546  Remarks:
9547  This feature is not available on all devices. Please refer to the specific
9548  device data sheet to determine availability.
9549 */
9550 
9551 void
9553  DMA_MODULE_ID index ,
9554  DMA_CHANNEL channel ,
9555  DMA_CHANNEL_DATA_SIZE channelDataSize ) ;
9556 //******************************************************************************
9557 /* Function:
9558  DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet ( DMA_MODULE_ID index,
9559  DMA_CHANNEL channel )
9560  Summary:
9561  Returns the current data size for the specified channel.
9562  Description:
9563  This function returns the current data size for the specified channel.
9564  Precondition:
9565  None.
9566  Parameters:
9567  channel - One of the possible DMA channels listed by DMA_CHANNEL
9568  Returns:
9569  - channelDataSize - One of the possible data sizes listed by
9570  DMA_CHANNEL_DATA_SIZE
9571  Example:
9572  <code>
9573  DMA_CHANNEL_DATA_SIZE channelDataSize;
9574  channelDataSize = PLIB_DMA_ChannelXDataSizeGet( DMA_ID_0,
9575  DMA_CHANNEL_4 );
9576  </code>
9577  Remarks:
9578  This feature is not available on all devices. Please refer to the specific
9579  device data sheet to determine availability.
9580 */
9581 
9582 DMA_CHANNEL_DATA_SIZE
9584  DMA_MODULE_ID index ,
9585  DMA_CHANNEL channel ) ;
9586 //******************************************************************************
9587 /* Function:
9588  void PLIB_DMA_ChannelXOperatingTransferModeSelect (
9589  DMA_MODULE_ID index,
9590  DMA_CHANNEL channel,
9591  DMA_TRANSFER_MODE channeltransferMode )
9592  Summary:
9593  Selects the transfer/operating mode for the specified channel.
9594  Description:
9595  This function selects the transfer/operating mode for the specified channel.
9596  (Transfer mode and operating mode are used interchangeably.)
9597  Precondition:
9598  None.
9599  Parameters:
9600  channel - One of the possible DMA channels listed by DMA_CHANNEL
9601  channeltransferMode - One of the possible operating/transfer modes listed by
9602  DMA_TRANSFER_MODE
9603  Returns:
9604  None.
9605  Example:
9606  <code>
9607  DMA_TRANSFER_MODE channeltransferMode = DMA_MODE_REPEATED_CONTINUOUS;
9608  PLIB_DMA_ChannelXOperatingTransferModeSelect ( DMA_ID_0,
9609  DMA_CHANNEL_4,
9610  channeltransferMode );
9611  </code>
9612  Remarks:
9613  This feature is not available on all devices. Please refer to the specific
9614  device data sheet to determine availability.
9615 */
9616 
9617 void
9619  DMA_MODULE_ID index ,
9620  DMA_CHANNEL channel ,
9621  DMA_TRANSFER_MODE channeltransferMode ) ;
9622 //******************************************************************************
9623 /* Function:
9624  DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet (
9625  DMA_MODULE_ID index,
9626  DMA_CHANNEL channel )
9627  Summary:
9628  Returns the current transfer/operating mode for the specified channel.
9629  Description:
9630  This function returns the current transfer/operating mode for the specified channel.
9631  (Transfer mode and operating mode are used interchangeably.)
9632  Precondition:
9633  None.
9634  Parameters:
9635  channel - One of the possible DMA channels listed by DMA_CHANNEL
9636  Returns:
9637  - channeltransferMode - One of the possible operating/transfer modes listed
9638  by DMA_TRANSFER_MODE
9639  Example:
9640  <code>
9641  DMA_TRANSFER_MODE channeltransferMode;
9642  channeltransferMode = PLIB_DMA_ChannelXOperatingTransferModeGet (
9643  DMA_ID_0,
9644  DMA_CHANNEL_4 );
9645  </code>
9646  Remarks:
9647  This feature is not available on all devices. Please refer to the specific
9648  device data sheet to determine availability.
9649 */
9650 
9651 DMA_TRANSFER_MODE
9653  DMA_MODULE_ID index ,
9654  DMA_CHANNEL channel ) ;
9655 //******************************************************************************
9656 /* Function:
9657  void PLIB_DMA_ChannelXReloadEnable( DMA_MODULE_ID index,
9658  DMA_CHANNEL channel )
9659  Summary:
9660  Enables reloading of the address and count registers.
9661  Description:
9662  This function enables reloading of the address and count registers. The source,
9663  destination address, and the DMA count registers are reloaded to their previous
9664  values upon the start of the next operation.
9665  Precondition:
9666  None.
9667  Parameters:
9668  channel - One of the possible DMA channels listed by DMA_CHANNEL
9669  Returns:
9670  None.
9671  Example:
9672  <code>
9673  PLIB_DMA_ChannelXReloadEnable ( DMA_ID_0,
9674  DMA_CHANNEL_4 );
9675  </code>
9676  Remarks:
9677  This feature is not available on all devices. Please refer to the specific
9678  device data sheet to determine availability.
9679 */
9680 
9681 void
9683  DMA_MODULE_ID index ,
9684  DMA_CHANNEL channel ) ;
9685 //******************************************************************************
9686 /* Function:
9687  bool PLIB_DMA_ChannelXReloadIsEnabled ( DMA_MODULE_ID index,
9688  DMA_CHANNEL channel )
9689  Summary:
9690  Returns the address and count registers reload enable status.
9691  Description:
9692  This function returns the address and count registers reload enable status.
9693  Precondition:
9694  None.
9695  Parameters:
9696  channel - One of the possible DMA channels listed by DMA_CHANNEL
9697  Returns:
9698  - true - The address and count registers reload is enabled
9699  - false - The address and count registers reload is disabled
9700  Example:
9701  <code>
9702  bool chAddressCountReloadStatus;
9703  chAddressCountReloadStatus = PLIB_DMA_ChannelXReloadIsEnabled (
9704  DMA_ID_0,
9705  DMA_CHANNEL_4 );
9706  </code>
9707  Remarks:
9708  This feature is not available on all devices. Please refer to the specific
9709  device data sheet to determine availability.
9710 */
9711 
9712 bool
9714  DMA_MODULE_ID index ,
9715  DMA_CHANNEL channel ) ;
9716 //******************************************************************************
9717 /* Function:
9718  void PLIB_DMA_ChannelXReloadDisable ( DMA_MODULE_ID index,
9719  DMA_CHANNEL channel )
9720  Summary:
9721  Disables reloading of the address and count registers.
9722  Description:
9723  This function disables reloading of the address and count registers. The source, destination
9724  address, and the DMA count registers are not reloaded to their previous values upon
9725  the start of the next operation.
9726  Precondition:
9727  None.
9728  Parameters:
9729  channel - One of the possible DMA channels listed by DMA_CHANNEL
9730  Returns:
9731  None.
9732  Example:
9733  <code>
9734  PLIB_DMA_ChannelXReloadDisable ( DMA_ID_0,
9735  DMA_CHANNEL_4 );
9736  </code>
9737  Remarks:
9738  This feature is not available on all devices. Please refer to the specific
9739  device data sheet to determine availability.
9740 */
9741 
9742 void
9744  DMA_MODULE_ID index ,
9745  DMA_CHANNEL channel ) ;
9746 //******************************************************************************
9747 /* Function:
9748  void PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_MODULE_ID index,
9749  DMA_CHANNEL channel )
9750  Summary:
9751  Enables the Null Write mode.
9752  Description:
9753  This function enables the Null Write mode. A dummy write is initiated to the
9754  source address for every write to the destination address.
9755  Precondition:
9756  None.
9757  Parameters:
9758  channel - One of the possible DMA channels listed by DMA_CHANNEL
9759  Returns:
9760  None.
9761  Example:
9762  <code>
9763  PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_ID_0,
9764  DMA_CHANNEL_4 );
9765  </code>
9766  Remarks:
9767  This feature is not available on all devices. Please refer to the specific
9768  device data sheet to determine availability.
9769 */
9770 
9771 void
9773  DMA_MODULE_ID index ,
9774  DMA_CHANNEL channel ) ;
9775 //******************************************************************************
9776 /* Function:
9777  bool PLIB_DMA_ChannelXNullWriteModeIsEnabled ( DMA_MODULE_ID index,
9778  DMA_CHANNEL channel )
9779  Summary:
9780  Returns the enable status of the Null Write mode for the specified channel.
9781  Description:
9782  This function returns the enable status of the Null Write mode for the specified channel.
9783  Precondition:
9784  None.
9785  Parameters:
9786  channel - One of the possible DMA channels listed by DMA_CHANNEL
9787  Returns:
9788  - true - Null write mode is enabled for this channel
9789  - false - Null write mode is disabled for this channel
9790  Example:
9791  <code>
9792  bool chNullWriteStatus;
9793  chNullWriteStatus = PLIB_DMA_ChannelXNullWriteModeIsEnabled (
9794  DMA_ID_0,
9795  DMA_CHANNEL_4 );
9796  </code>
9797  Remarks:
9798  This feature is not available on all devices. Please refer to the specific
9799  device data sheet to determine availability.
9800 */
9801 
9802 bool
9804  DMA_MODULE_ID index ,
9805  DMA_CHANNEL channel ) ;
9806 //******************************************************************************
9807 /* Function:
9808  void PLIB_DMA_ChannelXNullWriteModeDisable( DMA_MODULE_ID index,
9809  DMA_CHANNEL channel )
9810  Summary:
9811  Disables the Null Write mode.
9812  Description:
9813  This function disables the Null Write mode. No dummy write is initiated.
9814  Precondition:
9815  None.
9816  Parameters:
9817  channel - One of the possible DMA channels listed by DMA_CHANNEL
9818  Returns:
9819  None.
9820  Example:
9821  <code>
9822  PLIB_DMA_ChannelXNullWriteModeDisable ( DMA_ID_0,
9823  DMA_CHANNEL_4 );
9824  </code>
9825  Remarks:
9826  This feature is not available on all devices. Please refer to the specific
9827  device data sheet to determine availability.
9828 */
9829 
9830 void
9832  DMA_MODULE_ID index ,
9833  DMA_CHANNEL channel ) ;
9834 // *****************************************************************************
9835 // *****************************************************************************
9836 // Section: DMA start/end functions
9837 // *****************************************************************************
9838 // *****************************************************************************
9839 //******************************************************************************
9840 /* Function:
9841  void PLIB_DMA_StartTransferSet ( DMA_MODULE_ID index,
9842  DMA_CHANNEL channel )
9843  Summary:
9844  Initiates transfer on the specified channel.
9845  Description:
9846  This function initiates transfer on the specified channel. This is a forced transfer
9847  controlled via software.
9848  Precondition:
9849  None.
9850  Parameters:
9851  channel - One of the possible DMA channels listed by DMA_CHANNEL
9852  Returns:
9853  None.
9854  Example:
9855  <code>
9856  PLIB_DMA_StartTransferSet ( DMA_ID_0,
9857  DMA_CHANNEL_4 );
9858  </code>
9859  Remarks:
9860  This function implements an operation of the StartTransfer feature.
9861  This feature may not be available on all devices. Please refer to the
9862  specific device data sheet to determine availability or use the
9863  PLIB_DMA_ExistsStartTransfer function in your application to automatically
9864  determine whether this feature is available.
9865 */
9866 
9867 void
9869  DMA_MODULE_ID index ,
9870  DMA_CHANNEL channel ) ;
9871 //******************************************************************************
9872 /* Function:
9873  void PLIB_DMA_AbortTransferSet ( DMA_MODULE_ID index,
9874  DMA_CHANNEL channel )
9875  Summary:
9876  Aborts transfer on the specified channel.
9877  Description:
9878  This function aborts transfer on the specified channel. This is a forced abort
9879  controlled via software.
9880  Precondition:
9881  None.
9882  Parameters:
9883  channel - One of the possible DMA channels listed by DMA_CHANNEL
9884  Returns:
9885  None.
9886  Example:
9887  <code>
9888  PLIB_DMA_AbortTransferSet ( DMA_ID_0,
9889  DMA_CHANNEL_4 );
9890  </code>
9891  Remarks:
9892  This function implements an operation of the AbortTransfer feature.
9893  This feature may not be available on all devices. Please refer to the
9894  specific device data sheet to determine availability or use the
9895  PLIB_DMA_ExistsAbortTransfer function in your application to automatically
9896  determine whether this feature is available.
9897 */
9898 
9899 void
9901  DMA_MODULE_ID index ,
9902  DMA_CHANNEL channel ) ;
9903 // *****************************************************************************
9904 // *****************************************************************************
9905 // Section: DMA General Configuration functions
9906 // *****************************************************************************
9907 // *****************************************************************************
9908 //******************************************************************************
9909 /* Function:
9910  void PLIB_DMA_BusyActiveSet ( DMA_MODULE_ID index )
9911  Summary:
9912  Sets the BUSY bit of the DMA controller.
9913  Description:
9914  This function sets the BUSY bit of the DMA controller. The DMA module is active.
9915  Precondition:
9916  None.
9917  Parameters:
9918  None.
9919  Returns:
9920  None.
9921  Example:
9922  <code>
9923  PLIB_DMA_BusyActiveSet( DMA_ID_0 );
9924  </code>
9925  Remarks:
9926  This function implements an operation of the Busy feature.
9927  This feature may not be available on all devices. Please refer to the
9928  specific device data sheet to determine availability or use the
9929  PLIB_DMA_ExistsBusy function in your application to automatically
9930  determine whether this feature is available.
9931 */
9932 
9933 void
9935  DMA_MODULE_ID index ) ;
9936 //******************************************************************************
9937 /* Function:
9938  void PLIB_DMA_BusyActiveReset ( DMA_MODULE_ID index )
9939  Summary:
9940  Resets the BUSY bit of the DMA controller.
9941  Description:
9942  This function resets the BUSY bit of the DMA controller. The DMA module is
9943  disabled and is not actively transferring data.
9944  Precondition:
9945  None.
9946  Parameters:
9947  None.
9948  Returns:
9949  None.
9950  Example:
9951  <code>
9952  PLIB_DMA_BusyActiveReset( DMA_ID_0 );
9953  </code>
9954  Remarks:
9955  This function implements an operation of the Busy feature.
9956  This feature may not be available on all devices. Please refer to the
9957  specific device data sheet to determine availability or use the
9958  PLIB_DMA_ExistsBusy function in your application to automatically
9959  determine whether this feature is available.
9960 */
9961 
9962 void
9964  DMA_MODULE_ID index ) ;
9965 //******************************************************************************
9966 /* Function:
9967  bool PLIB_DMA_IsBusy ( DMA_MODULE_ID index )
9968  Summary:
9969  Gets the BUSY bit of the DMA controller.
9970  Description:
9971  This function gets the BUSY bit of the DMA controller.
9972  Precondition:
9973  None.
9974  Parameters:
9975  None.
9976  Returns:
9977  - true - DMA module is active
9978  - false - DMA module is disabled and is not actively transferring data
9979  Example:
9980  <code>
9981  bool dmaBusyStatus;
9982  dmaBusyStatus = PLIB_DMA_IsBusy( DMA_ID_0 );
9983  </code>
9984  Remarks:
9985  This function implements an operation of the Busy feature.
9986  This feature may not be available on all devices. Please refer to the
9987  specific device data sheet to determine availability or use the
9988  PLIB_DMA_ExistsBusy function in your application to automatically
9989  determine whether this feature is available.
9990 */
9991 
9992 bool
9993  PLIB_DMA_IsBusy (
9994  DMA_MODULE_ID index ) ;
9995 //******************************************************************************
9996 /* Function:
9997  void PLIB_DMA_SuspendEnable ( DMA_MODULE_ID index )
9998  Summary:
9999  DMA transfers are suspended to allow uninterrupted access by the CPU to the data bus.
10000  Description:
10001  This function suspends the DMA transfers to allow uninterrupted access
10002  by the CPU to the data bus.
10003  Precondition:
10004  None.
10005  Parameters:
10006  None.
10007  Returns:
10008  None.
10009  Example:
10010  <code>
10011  PLIB_DMA_SuspendEnable( DMA_ID_0 );
10012  </code>
10013  Remarks:
10014  This function implements an operation of the Suspend feature.
10015  This feature may not be available on all devices. Please refer to the
10016  specific device data sheet to determine availability or use the
10017  PLIB_DMA_ExistsSuspend function in your application to automatically
10018  determine whether this feature is available.
10019 */
10020 
10021 void
10023  DMA_MODULE_ID index ) ;
10024 //******************************************************************************
10025 /* Function:
10026  void PLIB_DMA_SuspendDisable ( DMA_MODULE_ID index )
10027  Summary:
10028  DMA suspend is disabled and the DMA module operates normally.
10029  Description:
10030  This function disables the DMA suspend. The DMA module continues to operate
10031  normally.
10032  Precondition:
10033  None.
10034  Parameters:
10035  None.
10036  Returns:
10037  None.
10038  Example:
10039  <code>
10040  PLIB_DMA_SuspendDisable( DMA_ID_0 );
10041  </code>
10042  Remarks:
10043  This function implements an operation of the Suspend feature.
10044  This feature may not be available on all devices. Please refer to the
10045  specific device data sheet to determine availability or use the
10046  PLIB_DMA_ExistsSuspend function in your application to automatically
10047  determine whether this feature is available.
10048 */
10049 
10050 void
10052  DMA_MODULE_ID index ) ;
10053 //******************************************************************************
10054 /* Function:
10055  bool PLIB_DMA_SuspendIsEnabled ( DMA_MODULE_ID index )
10056  Summary:
10057  Returns the DMA suspend status.
10058  Description:
10059  This function returns the DMA suspend status.
10060  Precondition:
10061  None.
10062  Parameters:
10063  None.
10064  Returns:
10065  - true - The DMA transfers are suspended
10066  - false - The DMA operates normally
10067  Example:
10068  <code>
10069  bool dmaSuspendStatus;
10070  dmaSuspendStatus = PLIB_DMA_SuspendIsEnabled( DMA_ID_0 );
10071  </code>
10072  Remarks:
10073  This function implements an operation of the Suspend feature.
10074  This feature may not be available on all devices. Please refer to the
10075  specific device data sheet to determine availability or use the
10076  PLIB_DMA_ExistsSuspend function in your application to automatically
10077  determine whether this feature is available.
10078 */
10079 
10080 bool
10082  DMA_MODULE_ID index ) ;
10083 //******************************************************************************
10084 /* Function:
10085  void PLIB_DMA_StopInIdleEnable ( DMA_MODULE_ID index )
10086  Summary:
10087  DMA transfers are halted during Idle mode.
10088  Description:
10089  This function halts DMA transfers during Idle mode.
10090  Precondition:
10091  None.
10092  Parameters:
10093  None.
10094  Returns:
10095  None.
10096  Example:
10097  <code>
10098  PLIB_DMA_StopInIdleEnable( DMA_ID_0 );
10099  </code>
10100  Remarks:
10101  This function implements an operation of the StopInIdle feature.
10102  This feature may not be available on all devices. Please refer to the
10103  specific device data sheet to determine availability or use the
10104  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10105  determine whether this feature is available.
10106 */
10107 
10108 void
10110  DMA_MODULE_ID index ) ;
10111 //******************************************************************************
10112 /* Function:
10113  void PLIB_DMA_StopInIdleDisable ( DMA_MODULE_ID index )
10114  Summary:
10115  DMA transfers continue during Idle mode.
10116  Description:
10117  This function causes DMA transfers to continue during Idle mode.
10118  Precondition:
10119  None.
10120  Parameters:
10121  None.
10122  Returns:
10123  None.
10124  Example:
10125  <code>
10126  PLIB_DMA_StopInIdleDisable( DMA_ID_0 );
10127  </code>
10128  Remarks:
10129  This function implements an operation of the StopInIdle feature.
10130  This feature may not be available on all devices. Please refer to the
10131  specific device data sheet to determine availability or use the
10132  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10133  determine whether this feature is available.
10134 */
10135 
10136 void
10138  DMA_MODULE_ID index ) ;
10139 //******************************************************************************
10140 /* Function:
10141  void PLIB_DMA_Enable ( DMA_MODULE_ID index )
10142  Summary:
10143  DMA module is enabled.
10144  Description:
10145  This function enables the DMA module.
10146  Precondition:
10147  None.
10148  Parameters:
10149  None.
10150  Returns:
10151  None.
10152  Example:
10153  <code>
10154  PLIB_DMA_Enable( DMA_ID_0 );
10155  </code>
10156  Remarks:
10157  This function implements an operation of the EnableControl feature.
10158  This feature may not be available on all devices. Please refer to the
10159  specific device data sheet to determine availability or use the
10160  PLIB_DMA_ExistsEnableControl function in your application to automatically
10161  determine whether this feature is available.
10162 */
10163 
10164 void
10165  PLIB_DMA_Enable (
10166  DMA_MODULE_ID index ) ;
10167 //******************************************************************************
10168 /* Function:
10169  bool PLIB_DMA_IsEnabled ( DMA_MODULE_ID index )
10170  Summary:
10171  Returns the DMA module enable status.
10172  Description:
10173  This function returns the DMA module enable status.
10174  Precondition:
10175  None.
10176  Parameters:
10177  None.
10178  Returns:
10179  - true - The DMA is enabled
10180  - false - The DMA is disabled
10181  Example:
10182  <code>
10183  PLIB_DMA_IsEnabled( DMA_ID_0 );
10184  </code>
10185  Remarks:
10186  This function implements an operation of the EnableControl feature.
10187  This feature may not be available on all devices. Please refer to the
10188  specific device data sheet to determine availability or use the
10189  PLIB_DMA_ExistsEnableControl function in your application to automatically
10190  determine whether this feature is available.
10191 */
10192 
10193 bool
10195  DMA_MODULE_ID index ) ;
10196 //******************************************************************************
10197 /* Function:
10198  void PLIB_DMA_Disable ( DMA_MODULE_ID index )
10199  Summary:
10200  DMA module is disabled.
10201  Description:
10202  This function disables the DMA module.
10203  Precondition:
10204  None.
10205  Parameters:
10206  None.
10207  Returns:
10208  None.
10209  Example:
10210  <code>
10211  PLIB_DMA_Disable( DMA_ID_0 );
10212  </code>
10213  Remarks:
10214  This function implements an operation of the EnableControl feature.
10215  This feature may not be available on all devices. Please refer to the
10216  specific device data sheet to determine availability or use the
10217  PLIB_DMA_ExistsEnableControl function in your application to automatically
10218  determine whether this feature is available.
10219 */
10220 
10221 void
10223  DMA_MODULE_ID index ) ;
10224 // *****************************************************************************
10225 // *****************************************************************************
10226 // Section: DMA status functions
10227 // *****************************************************************************
10228 // *****************************************************************************
10229 //******************************************************************************
10230 /* Function:
10231  uint8_t PLIB_DMA_ChannelBitsGet ( DMA_MODULE_ID index )
10232  Summary:
10233  Returns the DMA channel bits.
10234  Description:
10235  This function returns the channel bits.
10236  Precondition:
10237  None.
10238  Parameters:
10239  None.
10240  Returns:
10241  - uint8_t - DMA channel bits
10242  Example:
10243  <code>
10244  uint8_t dmaChBits;
10245  dmaChBits = PLIB_DMA_ChannelBitsGet( DMA_ID_0 );
10246  </code>
10247  Remarks:
10248  This function implements an operation of the ChannelBits feature.
10249  This feature may not be available on all devices. Please refer to the
10250  specific device data sheet to determine availability or use the
10251  PLIB_DMA_ExistsChannelBits function in your application to automatically
10252  determine whether this feature is available.
10253 */
10254 
10255 uint8_t
10257  DMA_MODULE_ID index ) ;
10258 //******************************************************************************
10259 /* Function:
10260  bool PLIB_DMA_LastBusAccessIsRead ( DMA_MODULE_ID index )
10261  Summary:
10262  Returns true if the last DMA bus access was a read.
10263  Description:
10264  This function returns true if the last DMA bus access was a read.
10265  Precondition:
10266  None.
10267  Parameters:
10268  None.
10269  Returns:
10270  - true - The last bus access was a read
10271  - false - The last bus access was not a read
10272  Example:
10273  <code>
10274  bool dmaLastBusAccessType;
10275  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsRead( DMA_ID_0 );
10276  </code>
10277  Remarks:
10278  This function implements an operation of the LastBusAccess feature.
10279  This feature may not be available on all devices. Please refer to the
10280  specific device data sheet to determine availability or use the
10281  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10282  determine whether this feature is available.
10283 */
10284 
10285 bool
10287  DMA_MODULE_ID index ) ;
10288 //******************************************************************************
10289 /* Function:
10290  bool PLIB_DMA_LastBusAccessIsWrite ( DMA_MODULE_ID index )
10291  Summary:
10292  Returns true if the last DMA bus access was a write.
10293  Description:
10294  This function returns true if the last DMA bus access was a write operation.
10295  Precondition:
10296  None.
10297  Parameters:
10298  None.
10299  Returns:
10300  - true - The last bus access was a write operation
10301  - false - The last bus access was not a write operation
10302  Example:
10303  <code>
10304  bool dmaLastBusAccessType;
10305  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsWrite( DMA_ID_0 );
10306  </code>
10307  Remarks:
10308  This function implements an operation of the LastBusAccess feature.
10309  This feature may not be available on all devices. Please refer to the
10310  specific device data sheet to determine availability or use the
10311  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10312  determine whether this feature is available.
10313 */
10314 
10315 bool
10317  DMA_MODULE_ID index ) ;
10318 //******************************************************************************
10319 /* Function:
10320  uint32_t PLIB_DMA_RecentAddressAccessed ( DMA_MODULE_ID index )
10321  Summary:
10322  Returns the address of the most recent DMA access.
10323  Description:
10324  This function returns the address of the most recent DMA access.
10325  Precondition:
10326  None.
10327  Parameters:
10328  None.
10329  Returns:
10330  - uint32_t - The most recent address accessed by the DMA
10331  Example:
10332  <code>
10333  uint32_t dmaLastAddressAccessed;
10334  dmaLastAddressAccessed = PLIB_DMA_RecentAddressAccessed( DMA_ID_0 );
10335  </code>
10336  Remarks:
10337  This function implements an operation of the RecentAddress feature.
10338  This feature may not be available on all devices. Please refer to the
10339  specific device data sheet to determine availability or use the
10340  PLIB_DMA_ExistsRecentAddress function in your application to automatically
10341  determine whether this feature is available.
10342 */
10343 
10344 uint32_t
10346  DMA_MODULE_ID index ) ;
10347 // *****************************************************************************
10348 // *****************************************************************************
10349 // Section: DMA Module CRC Feature Interface Functions
10350 // *****************************************************************************
10351 // *****************************************************************************
10352 //******************************************************************************
10353 /* Function:
10354  void PLIB_DMA_CRCChannelSelect( DMA_MODULE_ID index,
10355  DMA_CHANNEL channel )
10356  Summary:
10357  Assigns the CRC to the specified DMA channel.
10358  Description:
10359  This function assigns the CRC feature to the specified channel.
10360  Precondition:
10361  None.
10362  Parameters:
10363  channel - One of the possible DMA channels listed by DMA_CHANNEL
10364  Returns:
10365  None.
10366  Example:
10367  <code>
10368  PLIB_DMA_CRCChannelSelect( DMA_ID_0,
10369  DMA_CHANNEL_5 );
10370  </code>
10371  Remarks:
10372  This function implements an operation of the CRCChannel feature.
10373  This feature may not be available on all devices. Please refer to the
10374  specific device data sheet to determine availability or use the
10375  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10376  determine whether this feature is available.
10377 */
10378 
10379 void
10381  DMA_MODULE_ID index ,
10382  DMA_CHANNEL channel ) ;
10383 //******************************************************************************
10384 /* Function:
10385  DMA_CHANNEL PLIB_DMA_CRCChannelGet ( DMA_MODULE_ID index )
10386  Summary:
10387  Returns the current DMA channel to which the CRC is assigned.
10388  Description:
10389  This function returns the current DMA channel to which the CRC is assigned.
10390  Precondition:
10391  None.
10392  Parameters:
10393  None.
10394  Returns:
10395  crcChannel - One of the possible DMA channels listed by DMA_CHANNEL
10396  Example:
10397  <code>
10398  DMA_CHANNEL crcChannel;
10399  crcChannel = PLIB_DMA_CRCChannelGet( DMA_ID_0 );
10400  </code>
10401  Remarks:
10402  This function implements an operation of the CRCChannel feature.
10403  This feature may not be available on all devices. Please refer to the
10404  specific device data sheet to determine availability or use the
10405  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10406  determine whether this feature is available.
10407 */
10408 
10409 DMA_CHANNEL
10411  DMA_MODULE_ID index ) ;
10412 //******************************************************************************
10413 /* Function:
10414  void PLIB_DMA_CRCTypeSet ( DMA_MODULE_ID index,
10415  DMA_CRC_TYPE CRCType )
10416  Summary:
10417  Selects the DMA module CRC feature type.
10418  Description:
10419  This function selects the DMA module CRC feature type. The CRC feature will
10420  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10421  checksum.
10422  Precondition:
10423  None.
10424  Parameters:
10425  CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE
10426  Returns:
10427  None.
10428  Example:
10429  <code>
10430  PLIB_DMA_CRCTypeSet(DMA_ID_0,
10431  DMA_CRC_IP_HEADER );
10432  </code>
10433  Remarks:
10434  This function implements an operation of the CRCType feature.
10435  This feature may not be available on all devices. Please refer to the
10436  specific device data sheet to determine availability or use the
10437  PLIB_DMA_ExistsCRCType function in your application to automatically
10438  determine whether this feature is available.
10439 */
10440 
10441 void
10443  DMA_MODULE_ID index ,
10444  DMA_CRC_TYPE CRCType ) ;
10445 //******************************************************************************
10446 /* Function:
10447  DMA_CRC_TYPE PLIB_DMA_CRCTypeGet ( DMA_MODULE_ID index )
10448  Summary:
10449  Gets the current DMA module CRC feature type.
10450  Description:
10451  This function gets the DMA module CRC feature type. The CRC feature will
10452  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10453  checksum.
10454  Precondition:
10455  None.
10456  Parameters:
10457  None.
10458  Returns:
10459  - CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE.
10460  Example:
10461  <code>
10462  DMA_CRC_TYPE CRCType;
10463  CRCType = PLIB_DMA_CRCTypeGet( DMA_ID_0 );
10464  </code>
10465  Remarks:
10466  This function implements an operation of the CRCType feature.
10467  This feature may not be available on all devices. Please refer to the
10468  specific device data sheet to determine availability or use the
10469  PLIB_DMA_ExistsCRCType function in your application to automatically
10470  determine whether this feature is available.
10471 */
10472 
10473 DMA_CRC_TYPE
10475  DMA_MODULE_ID index ) ;
10476 //******************************************************************************
10477 /* Function:
10478  void PLIB_DMA_CRCAppendModeEnable ( DMA_MODULE_ID index )
10479  Summary:
10480  Enables the CRC append mode.
10481  Description:
10482  This function enables the CRC append mode. The DMA transfers data from the source
10483  into the CRC, but not to the destination. When a block transfer completes, the
10484  DMA writes the calculated CRC value to the location specified by the CHxDSA register.
10485  Precondition:
10486  None.
10487  Parameters:
10488  None.
10489  Returns:
10490  None.
10491  Example:
10492  <code>
10493  PLIB_DMA_CRCAppendModeEnable( DMA_ID_0 );
10494  </code>
10495  Remarks:
10496  This function implements an operation of the CRCAppendMode feature.
10497  This feature may not be available on all devices. Please refer to the
10498  specific device data sheet to determine availability or use the
10499  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10500  determine whether this feature is available.
10501 */
10502 
10503 void
10505  DMA_MODULE_ID index ) ;
10506 //******************************************************************************
10507 /* Function:
10508  bool PLIB_DMA_CRCAppendModeIsEnabled ( DMA_MODULE_ID index )
10509  Summary:
10510  Gets the enable status of the CRC append mode.
10511  Description:
10512  This function gets the enable status of the CRC append mode.
10513  Precondition:
10514  None.
10515  Parameters:
10516  None.
10517  Returns:
10518  - true - CRC append mode is enabled
10519  - false - CRC append mode is disabled
10520  Example:
10521  <code>
10522  bool DMAcrcAppendMode;
10523  DMAcrcAppendMode = PLIB_DMA_CRCAppendModeIsEnabled( DMA_ID_0 );
10524  </code>
10525  Remarks:
10526  This function implements an operation of the CRCAppendMode feature.
10527  This feature may not be available on all devices. Please refer to the
10528  specific device data sheet to determine availability or use the
10529  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10530  determine whether this feature is available.
10531 */
10532 
10533 bool
10535  DMA_MODULE_ID index ) ;
10536 //******************************************************************************
10537 /* Function:
10538  void PLIB_DMA_CRCAppendModeDisable ( DMA_MODULE_ID index )
10539  Summary:
10540  Disables the CRC append mode.
10541  Description:
10542  This function disables the CRC append mode. The DMA transfers data from the
10543  source through the CRC obeying WBO (DMA_MODULE_ID index, write byte order)
10544  as it writes the data to the destination.
10545  Precondition:
10546  None.
10547  Parameters:
10548  None.
10549  Returns:
10550  None.
10551  Example:
10552  <code>
10553  PLIB_DMA_CRCAppendModeDisable( DMA_ID_0 );
10554  </code>
10555  Remarks:
10556  This function implements an operation of the CRCAppendMode feature.
10557  This feature may not be available on all devices. Please refer to the
10558  specific device data sheet to determine availability or use the
10559  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10560  determine whether this feature is available.
10561 */
10562 
10563 void
10565  DMA_MODULE_ID index ) ;
10566 //******************************************************************************
10567 /* Function:
10568  void PLIB_DMA_CRCEnable ( DMA_MODULE_ID index )
10569  Summary:
10570  Enables the DMA module CRC feature.
10571  Description:
10572  This function enables the DMA module CRC feature. The channel transfers are
10573  routed through the CRC.
10574  Precondition:
10575  None.
10576  Parameters:
10577  None.
10578  Returns:
10579  None.
10580  Example:
10581  <code>
10582  PLIB_DMA_CRCEnable( DMA_ID_0 );
10583  </code>
10584  Remarks:
10585  This function implements an operation of the CRC feature.
10586  This feature may not be available on all devices. Please refer to the
10587  specific device data sheet to determine availability or use the
10588  PLIB_DMA_ExistsCRC function in your application to automatically
10589  determine whether this feature is available.
10590 */
10591 
10592 void
10594  DMA_MODULE_ID index ) ;
10595 //******************************************************************************
10596 /* Function:
10597  bool PLIB_DMA_CRCIsEnabled ( DMA_MODULE_ID index )
10598  Summary:
10599  Gets the enable status of the CRC feature.
10600  Description:
10601  This function gets the enable status of the CRC feature.
10602  Precondition:
10603  None.
10604  Parameters:
10605  None.
10606  Returns:
10607  - true - The CRC feature is enabled
10608  - false - The CRC feature is disabled
10609  Example:
10610  <code>
10611  bool DMAcrcStatus;
10612  DMAcrcStatus = PLIB_DMA_CRCIsEnabled( DMA_ID_0 );
10613  </code>
10614  Remarks:
10615  This function implements an operation of the CRC feature.
10616  This feature may not be available on all devices. Please refer to the
10617  specific device data sheet to determine availability or use the
10618  PLIB_DMA_ExistsCRC function in your application to automatically
10619  determine whether this feature is available.
10620 */
10621 
10622 bool
10624  DMA_MODULE_ID index ) ;
10625 //******************************************************************************
10626 /* Function:
10627  void PLIB_DMA_CRCDisable ( DMA_MODULE_ID index )
10628  Summary:
10629  Disables the DMA module CRC feature.
10630  Description:
10631  This function disables the DMA module CRC feature. The channel transfers proceed
10632  normally.
10633  Precondition:
10634  None.
10635  Parameters:
10636  None.
10637  Returns:
10638  None.
10639  Example:
10640  <code>
10641  PLIB_DMA_CRCDisable( DMA_ID_0 );
10642  </code>
10643  Remarks:
10644  This function implements an operation of the CRC feature.
10645  This feature may not be available on all devices. Please refer to the
10646  specific device data sheet to determine availability or use the
10647  PLIB_DMA_ExistsCRC function in your application to automatically
10648  determine whether this feature is available.
10649 */
10650 
10651 void
10653  DMA_MODULE_ID index ) ;
10654 //******************************************************************************
10655 /* Function:
10656  void PLIB_DMA_CRCPolynomialLengthSet ( DMA_MODULE_ID index,
10657  uint8_t polyLength )
10658  Summary:
10659  Selects the polynomial length.
10660  Description:
10661  This function Selects the polynomial length.
10662  Precondition:
10663  None.
10664  Parameters:
10665  polyLength - Polynomial length
10666  Returns:
10667  None.
10668  Example:
10669  <code>
10670  uint8_t polyLength = 0x2;
10671  PLIB_DMA_CRCPolynomialLengthSet( DMA_ID_0, polyLength );
10672  </code>
10673  Remarks:
10674  This function implements an operation of the CRCPolynomialLength feature.
10675  This feature may not be available on all devices. Please refer to the
10676  specific device data sheet to determine availability or use the
10677  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
10678  determine whether this feature is available.
10679 */
10680 
10681 void
10683  DMA_MODULE_ID index ,
10684  uint8_t polyLength ) ;
10685 //******************************************************************************
10686 /* Function:
10687  uint8_t PLIB_DMA_CRCPolynomialLengthGet ( DMA_MODULE_ID index )
10688  Summary:
10689  Gets the current polynomial length.
10690  Description:
10691  This function gets the current polynomial length.
10692  Precondition:
10693  None.
10694  Parameters:
10695  None.
10696  Returns:
10697  - uint8_t - Polynomial length
10698  Example:
10699  <code>
10700  uint8_t polyLength;
10701  polyLength = PLIB_DMA_CRCPolynomialLengthGet( DMA_ID_0 );
10702  </code>
10703  Remarks:
10704  This function implements an operation of the CRCPolynomialLength feature.
10705  This feature may not be available on all devices. Please refer to the
10706  specific device data sheet to determine availability or use the
10707  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
10708  determine whether this feature is available.
10709 */
10710 
10711 uint8_t
10713  DMA_MODULE_ID index ) ;
10714 //******************************************************************************
10715 /* Function:
10716  void PLIB_DMA_CRCBitOrderSelect ( DMA_MODULE_ID index,
10717  DMA_CRC_BIT_ORDER bitOrder )
10718  Summary:
10719  Selects the bit order for checksum calculation.
10720  Description:
10721  This function selects the bit order for checksum calculation.
10722  Precondition:
10723  None.
10724  Parameters:
10725  bitOrder - Specifies the bit order for CRC calculation
10726  Returns:
10727  None.
10728  Example:
10729  <code>
10730  PLIB_DMA_CRCBitOrderSelect ( DMA_ID_0,DMA_CRC_BIT_ORDER_LSB );
10731  </code>
10732  Remarks:
10733  This function implements an operation of the CRCBitOrder feature.
10734  This feature may not be available on all devices. Please refer to the
10735  specific device data sheet to determine availability or use the
10736  PLIB_DMA_ExistsCRCBitOrder function in your application to automatically
10737  determine whether this feature is available.
10738 */
10739 
10740 void
10742  DMA_MODULE_ID index ,
10743  DMA_CRC_BIT_ORDER bitOrder ) ;
10744 //******************************************************************************
10745 /* Function:
10746  void PLIB_DMA_CRCWriteByteOrderAlter ( DMA_MODULE_ID index )
10747  Summary:
10748  The source data is written to the destination reordered as defined by the
10749  BYTO<1:0> bits.
10750  Description:
10751  This function enables byte order alteration as specified by the BYTO<1:0> bits.
10752  The source data is written to the destination reordered as defined by the
10753  BYTO<1:0> bits.
10754  Precondition:
10755  None.
10756  Parameters:
10757  None.
10758  Returns:
10759  None.
10760  Example:
10761  <code>
10762  PLIB_DMA_CRCWriteByteOrderAlter ( DMA_ID_0 );
10763  </code>
10764  Remarks:
10765  This function implements an operation of the CRCWriteByteOrder feature.
10766  This feature may not be available on all devices. Please refer to the
10767  specific device data sheet to determine availability or use the
10768  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
10769  determine whether this feature is available.
10770 */
10771 
10772 void
10774  DMA_MODULE_ID index ) ;
10775 //******************************************************************************
10776 /* Function:
10777  void PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_MODULE_ID index )
10778  Summary:
10779  The source data is written to the destination unaltered.
10780  Description:
10781  This function disables byte order alteration. The source data is written
10782  to the destination unaltered.
10783  Precondition:
10784  None.
10785  Parameters:
10786  None.
10787  Returns:
10788  None.
10789  Example:
10790  <code>
10791  PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_ID_0 );
10792  </code>
10793  Remarks:
10794  This function implements an operation of the CRCWriteByteOrder feature.
10795  This feature may not be available on all devices. Please refer to the
10796  specific device data sheet to determine availability or use the
10797  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
10798  determine whether this feature is available.
10799 */
10800 
10801 void
10803  DMA_MODULE_ID index ) ;
10804 //******************************************************************************
10805 /* Function:
10806  void PLIB_DMA_CRCByteOrderSelect ( DMA_MODULE_ID index,
10807  DMA_CRC_BYTE_ORDER byteOrder )
10808  Summary:
10809  Selects the byte order.
10810  Description:
10811  This function selects the byte order.
10812  Precondition:
10813  The WBO bit must be set to use this function.
10814  Parameters:
10815  byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
10816  Returns:
10817  None.
10818  Example:
10819  <code>
10820  PLIB_DMA_CRCByteOrderSelect ( DMA_ID_0,
10821  DMA_CRC_SWAP_HALF_WORD_ON_WORD_BOUNDARY );
10822  </code>
10823  Remarks:
10824  This function implements an operation of the CRCByteOrder feature.
10825  This feature may not be available on all devices. Please refer to the
10826  specific device data sheet to determine availability or use the
10827  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
10828  determine whether this feature is available.
10829 */
10830 
10831 void
10833  DMA_MODULE_ID index ,
10834  DMA_CRC_BYTE_ORDER byteOrder ) ;
10835 //******************************************************************************
10836 /* Function:
10837  DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet ( DMA_MODULE_ID index )
10838  Summary:
10839  Gets the current byte order selected by the DMA module CRC feature.
10840  Description:
10841  This function gets the current byte order selected by the DMA module CRC feature.
10842  Precondition:
10843  The WBO bit must be set to use this function.
10844  Parameters:
10845  None.
10846  Returns:
10847  - byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
10848  Example:
10849  <code>
10850  DMA_CRC_BYTE_ORDER byteOrder;
10851  byteOrder = PLIB_DMA_CRCByteOrderGet ( DMA_ID_0 );
10852  </code>
10853  Remarks:
10854  This function implements an operation of the CRCByteOrder feature.
10855  This feature may not be available on all devices. Please refer to the
10856  specific device data sheet to determine availability or use the
10857  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
10858  determine whether this feature is available.
10859 */
10860 
10861 DMA_CRC_BYTE_ORDER
10863  DMA_MODULE_ID index ) ;
10864 //******************************************************************************
10865 /* Function:
10866  uint32_t PLIB_DMA_CRCDataRead ( DMA_MODULE_ID index )
10867  Summary:
10868  Reads the contents of the DMA CRC data register.
10869  Description:
10870  This function reads the contents of the DMA CRC data register.
10871  Precondition:
10872  None.
10873  Parameters:
10874  None.
10875  Returns:
10876  - uint32_t - 32-bit CRC data
10877  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10878  device data sheet to determine availability.
10879  Example:
10880  <code>
10881  uint32_t DMACRCdata;
10882  DMACRCdata = PLIB_DMA_CRCDataRead ( DMA_ID_0 );
10883  </code>
10884  Remarks:
10885  This function implements an operation of the CRCData feature.
10886  This feature may not be available on all devices. Please refer to the
10887  specific device data sheet to determine availability or use the
10888  PLIB_DMA_ExistsCRCData function in your application to automatically
10889  determine whether this feature is available.
10890 */
10891 
10892 uint32_t
10894  DMA_MODULE_ID index ) ;
10895 //******************************************************************************
10896 /* Function:
10897  void PLIB_DMA_CRCDataWrite ( DMA_MODULE_ID index,
10898  uint32_t DMACRCdata )
10899  Summary:
10900  Writes the contents of the DMA CRC data register with the specified data.
10901  Description:
10902  This function writes the contents of the DMA CRC data register.
10903  Precondition:
10904  None.
10905  Parameters:
10906  - DMACRCdata - 32-bit CRC data
10907  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10908  device data sheet to determine availability.
10909  Returns:
10910  None.
10911  Example:
10912  <code>
10913  uint32_t DMACRCdata = 0x0E0E0E;
10914  PLIB_DMA_CRCDataWrite ( DMA_ID_0, DMACRCdata );
10915  </code>
10916  Remarks:
10917  This function implements an operation of the CRCData feature.
10918  This feature may not be available on all devices. Please refer to the
10919  specific device data sheet to determine availability or use the
10920  PLIB_DMA_ExistsCRCData function in your application to automatically
10921  determine whether this feature is available.
10922 */
10923 
10924 void
10926  DMA_MODULE_ID index ,
10927  uint32_t DMACRCdata ) ;
10928 //******************************************************************************
10929 /* Function:
10930  uint32_t PLIB_DMA_CRCXOREnableGet ( DMA_MODULE_ID index )
10931  Summary:
10932  Reads the CRC XOR register.
10933  Description:
10934  This function reads the CRC XOR register.
10935  Precondition:
10936  None.
10937  Parameters:
10938  None.
10939  Returns:
10940  - uint32_t - 32-bit CRC XOR enable mask data
10941  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10942  device data sheet to determine availability.
10943  Example:
10944  <code>
10945  uint32_t DMACRCXORdata;
10946  DMACRCXORdata = PLIB_DMA_CRCXOREnableGet ( DMA_ID_0 );
10947  </code>
10948  Remarks:
10949  This function implements an operation of the CRCXOREnable feature.
10950  This feature may not be available on all devices. Please refer to the
10951  specific device data sheet to determine availability or use the
10952  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
10953  determine whether this feature is available.
10954 */
10955 
10956 uint32_t
10958  DMA_MODULE_ID index ) ;
10959 //******************************************************************************
10960 /* Function:
10961  void PLIB_DMA_CRCXOREnableSet ( DMA_MODULE_ID index,
10962  uint32_t DMACRCXOREnableMask )
10963  Summary:
10964  Writes to the CRC XOR enable register as per the specified enable mask.
10965  Description:
10966  This function writes to the CRC XOR enable register as per the specified
10967  enable mask. Each enabled bit will be taken as input to the shift register.
10968  Precondition:
10969  None.
10970  Parameters:
10971  - DMACRCXOREnableMask - 32-bit CRC XOR enable mask data
10972  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10973  device data sheet to determine availability.
10974  Returns:
10975  None.
10976  Example:
10977  <code>
10978  uint32_t DMACRCXOREnableMask = 0x05EFFFFF;
10979  PLIB_DMA_CRCXOREnableSet ( DMA_ID_0, DMACRCXOREnableMask );
10980  </code>
10981  Remarks:
10982  This function implements an operation of the CRCXOREnable feature.
10983  This feature may not be available on all devices. Please refer to the
10984  specific device data sheet to determine availability or use the
10985  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
10986  determine whether this feature is available.
10987 */
10988 
10989 void
10991  DMA_MODULE_ID index ,
10992  uint32_t DMACRCXOREnableMask ) ;
10993 // *****************************************************************************
10994 // *****************************************************************************
10995 // Section: DMA Address control Interface functions
10996 // *****************************************************************************
10997 // *****************************************************************************
10998 //******************************************************************************
10999 /* Function:
11000  uint32_t PLIB_DMA_ChannelXSourceStartAddressGet ( DMA_MODULE_ID index,
11001  DMA_CHANNEL dmaChannel )
11002  Summary:
11003  Reads the source start address configured for the specified channel.
11004  Description:
11005  This function reads the source start address configured for the specified
11006  channel.
11007  Precondition:
11008  None.
11009  Parameters:
11010  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11011  Returns:
11012  - uint32_t - The source start address configured for this channel
11013  Example:
11014  <code>
11015  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11016  uint32_t SourceStartAddress;
11017  SourceStartAddress = PLIB_DMA_ChannelXSourceStartAddressGet(DMA_ID_0,
11018  spiDMAChannel );
11019  </code>
11020  Remarks:
11021  This function implements an operation of the ChannelXSourceStartAddress feature.
11022  This feature may not be available on all devices. Please refer to the
11023  specific device data sheet to determine availability or use the
11024  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11025  determine whether this feature is available.
11026 */
11027 
11028 uint32_t
11030  DMA_MODULE_ID index ,
11031  DMA_CHANNEL dmaChannel ) ;
11032 //******************************************************************************
11033 /* Function:
11034  void PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_MODULE_ID index,
11035  DMA_CHANNEL dmaChannel,
11036  uint32_t sourceStartAddress)
11037  Summary:
11038  Writes the specified source start address into the register
11039  corresponding to the specified channel.
11040  Description:
11041  This function writes the specified Source start address into the register
11042  corresponding to the specified channel.
11043  Precondition:
11044  None.
11045  Parameters:
11046  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11047  sourceStartAddress - The source start address
11048  Returns:
11049  None.
11050  Example:
11051  <code>
11052  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11053  uint32_t sourceStartAddress = 0x00FDEA00;
11054  PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_ID_0,
11055  spiDMAChannel,
11056  sourceStartAddress );
11057  </code>
11058  Remarks:
11059  This function implements an operation of the ChannelXSourceStartAddress feature.
11060  This feature may not be available on all devices. Please refer to the
11061  specific device data sheet to determine availability or use the
11062  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11063  determine whether this feature is available.
11064 */
11065 
11066 void
11068  DMA_MODULE_ID index ,
11069  DMA_CHANNEL dmaChannel ,
11070  uint32_t sourceStartAddress ) ;
11071 //******************************************************************************
11072 /* Function:
11073  uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet ( DMA_MODULE_ID index,
11074  DMA_CHANNEL dmaChannel )
11075  Summary:
11076  Reads the destination start address configured for the specified channel.
11077  Description:
11078  This function reads the destination start address configured for the specified
11079  channel.
11080  Precondition:
11081  None.
11082  Parameters:
11083  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11084  Returns:
11085  - uint32_t - The destination start address configured for this channel
11086  Example:
11087  <code>
11088  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11089  uint32_t DestinationStartAddress;
11090  DestinationStartAddress = PLIB_DMA_ChannelXDestinationStartAddressGet (
11091  DMA_ID_0,
11092  spiDMAChannel );
11093  </code>
11094  Remarks:
11095  This function implements an operation of the ChannelXDestinationStartAddress feature.
11096  This feature may not be available on all devices. Please refer to the
11097  specific device data sheet to determine availability or use the
11098  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11099  determine whether this feature is available.
11100 */
11101 
11102 uint32_t
11104  DMA_MODULE_ID index ,
11105  DMA_CHANNEL dmaChannel ) ;
11106 //******************************************************************************
11107 /* Function:
11108  void PLIB_DMA_ChannelXDestinationStartAddressSet (
11109  DMA_MODULE_ID index,
11110  DMA_CHANNEL dmaChannel,
11111  uint32_t destinationStartAddress)
11112  Summary:
11113  Writes the specified destination start address into the register corresponding to
11114  the specified channel.
11115  Description:
11116  This function writes the specified destination start address into the register
11117  corresponding to the specified channel.
11118  Precondition:
11119  None.
11120  Parameters:
11121  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11122  destinationStartAddress - The destination start address
11123  Returns:
11124  None.
11125  Example:
11126  <code>
11127  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11128  uint32_t destinationStartAddress = 0x00FDEA00;
11129  PLIB_DMA_ChannelXDestinationStartAddressSet( DMA_ID_0,
11130  spiDMAChannel,
11131  destinationStartAddress );
11132  </code>
11133  Remarks:
11134  This function implements an operation of the ChannelXDestinationStartAddress feature.
11135  This feature may not be available on all devices. Please refer to the
11136  specific device data sheet to determine availability or use the
11137  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11138  determine whether this feature is available.
11139 */
11140 
11141 void
11143  DMA_MODULE_ID index ,
11144  DMA_CHANNEL dmaChannel ,
11145  uint32_t destinationStartAddress ) ;
11146 // *****************************************************************************
11147 // *****************************************************************************
11148 // Section: DMA Data control Interface functions
11149 // *****************************************************************************
11150 // *****************************************************************************
11151 //******************************************************************************
11152 /* Function:
11153  uint16_t PLIB_DMA_ChannelXSourceSizeGet ( DMA_MODULE_ID index,
11154  DMA_CHANNEL dmaChannel )
11155  Summary:
11156  Reads the source size configured for the specified channel.
11157  Description:
11158  This function reads the source size configured for the specified
11159  channel.
11160  Precondition:
11161  None.
11162  Parameters:
11163  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11164  Returns:
11165  - uint16_t - The Source size configured (in bytes) for this channel.
11166  The source size (8-bit, 16-bit) is device-specific. Please refer to the specific
11167  device data sheet to determine availability.
11168  Example:
11169  <code>
11170  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11171  uint16_t sourceSize;
11172  sourceSize = PLIB_DMA_ChannelXSourceSizeGet ( DMA_ID_0,
11173  spiDMAChannel );
11174  </code>
11175  Remarks:
11176  This function implements an operation of the ChannelXSourceSize feature.
11177  This feature may not be available on all devices. Please refer to the
11178  specific device data sheet to determine availability or use the
11179  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11180  determine whether this feature is available.
11181 */
11182 
11183 uint16_t
11185  DMA_MODULE_ID index ,
11186  DMA_CHANNEL dmaChannel ) ;
11187 //******************************************************************************
11188 /* Function:
11189  void PLIB_DMA_ChannelXSourceSizeSet ( DMA_MODULE_ID index,
11190  DMA_CHANNEL dmaChannel,
11191  uint16_t sourceSize)
11192  Summary:
11193  Writes the specified source size into the register corresponding
11194  to the specified channel.
11195  Description:
11196  This function writes the specified source size into the register
11197  corresponding to the specified channel.
11198  Precondition:
11199  None.
11200  Parameters:
11201  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11202  sourceSize - The source size. The source size (8-bit, 16-bit) is
11203  device-specific. Please refer to the specific device data
11204  sheet to determine availability.
11205  Returns:
11206  None.
11207  Example:
11208  <code>
11209  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11210  uint16_t sourceSize = 0xA00;
11211  PLIB_DMA_ChannelXSourceSizeSet ( DMA_ID_0,
11212  spiDMAChannel,
11213  sourceSize );
11214  </code>
11215  Remarks:
11216  This function implements an operation of the ChannelXSourceSize feature.
11217  This feature may not be available on all devices. Please refer to the
11218  specific device data sheet to determine availability or use the
11219  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11220  determine whether this feature is available.
11221 */
11222 
11223 void
11225  DMA_MODULE_ID index ,
11226  DMA_CHANNEL dmaChannel ,
11227  uint16_t sourceSize ) ;
11228 //******************************************************************************
11229 /* Function:
11230  uint16_t PLIB_DMA_ChannelXDestinationSizeGet ( DMA_MODULE_ID index,
11231  DMA_CHANNEL dmaChannel )
11232  Summary:
11233  Reads the destination size configured for the specified channel.
11234  Description:
11235  This function reads the destination size configured for the specified
11236  channel.
11237  Precondition:
11238  None.
11239  Parameters:
11240  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11241  Returns:
11242  - uint16_t - The destination size configured (in bytes) for this channel.
11243  The destination size (8-bit, 16-bit) is device-specific. Please refer to the specific
11244  device data sheet to determine availability.
11245  Example:
11246  <code>
11247  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11248  uint16_t DestinationSize;
11249  DestinationSize = PLIB_DMA_ChannelXDestinationSizeGet ( DMA_ID_0,
11250  spiDMAChannel );
11251  </code>
11252  Remarks:
11253  This function implements an operation of the ChannelXDestinationSize feature.
11254  This feature may not be available on all devices. Please refer to the
11255  specific device data sheet to determine availability or use the
11256  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11257  determine whether this feature is available.
11258 */
11259 
11260 uint16_t
11262  DMA_MODULE_ID index ,
11263  DMA_CHANNEL dmaChannel ) ;
11264 //******************************************************************************
11265 /* Function:
11266  void PLIB_DMA_ChannelXDestinationSizeSet ( DMA_MODULE_ID index,
11267  DMA_CHANNEL dmaChannel,
11268  uint16_t destinationSize)
11269  Summary:
11270  Writes the specified destination size into the register corresponding
11271  to the specified channel.
11272  Description:
11273  This function writes the specified destination size into the register
11274  corresponding to the specified channel.
11275  Precondition:
11276  None.
11277  Parameters:
11278  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11279  destinationSize - The destination size. The destination size (8-bit, 16-bit)
11280  is device-specific. Please refer to the specific device
11281  data sheet to determine availability.)
11282  Returns:
11283  None.
11284  Example:
11285  <code>
11286  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11287  uint16_t destinationSize = 0xA00;
11288  PLIB_DMA_ChannelXDestinationSizeSet( DMA_ID_0, spiDMAChannel, destinationSize );
11289  </code>
11290  Remarks:
11291  This function implements an operation of the ChannelXDestinationSize feature.
11292  This feature may not be available on all devices. Please refer to the
11293  specific device data sheet to determine availability or use the
11294  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11295  determine whether this feature is available.
11296 */
11297 
11298 void
11300  DMA_MODULE_ID index ,
11301  DMA_CHANNEL dmaChannel ,
11302  uint16_t destinationSize ) ;
11303 //******************************************************************************
11304 /* Function:
11305  uint16_t PLIB_DMA_ChannelXSourcePointerGet ( DMA_MODULE_ID index,
11306  DMA_CHANNEL dmaChannel )
11307  Summary:
11308  Reads the current byte of the source being pointed to for the specified channel.
11309  Description:
11310  This function reads the current byte of the source being pointed to for the
11311  specified channel.
11312  Precondition:
11313  None.
11314  Parameters:
11315  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11316  Returns:
11317  - uint16_t - The source byte being pointed to for this channel.
11318  The source pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11319  device data sheet to determine availability.
11320  Example:
11321  <code>
11322  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11323  uint16_t sourcebyte;
11324  sourcebyte = PLIB_DMA_ChannelXSourcePointerGet ( DMA_ID_0, spiDMAChannel );
11325  </code>
11326  Remarks:
11327  This function implements an operation of the ChannelXSourcePointer feature.
11328  This feature may not be available on all devices. Please refer to the
11329  specific device data sheet to determine availability or use the
11330  PLIB_DMA_ExistsChannelXSourcePointer function in your application to automatically
11331  determine whether this feature is available.
11332 */
11333 
11334 uint16_t
11336  DMA_MODULE_ID index ,
11337  DMA_CHANNEL dmaChannel ) ;
11338 //******************************************************************************
11339 /* Function:
11340  uint16_t PLIB_DMA_ChannelXDestinationPointerGet ( DMA_MODULE_ID index,
11341  DMA_CHANNEL dmaChannel )
11342  Summary:
11343  Reads the current byte of the destination being pointed to for the specified channel.
11344  Description:
11345  This function reads the current byte of the destination being pointed to for the
11346  specified channel.
11347  Precondition:
11348  None.
11349  Parameters:
11350  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11351  Returns:
11352  - uint16_t - The destination byte being pointed to for this channel.
11353  The destination pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11354  device data sheet to determine availability.
11355  Example:
11356  <code>
11357  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11358  uint16_t destinationbyte;
11359  destinationbyte = PLIB_DMA_ChannelXDestinationPointerGet ( DMA_ID_0,
11360  spiDMAChannel );
11361  </code>
11362  Remarks:
11363  This function implements an operation of the ChannelXDestinationPointer feature.
11364  This feature may not be available on all devices. Please refer to the
11365  specific device data sheet to determine availability or use the
11366  PLIB_DMA_ExistsChannelXDestinationPointer function in your application to automatically
11367  determine whether this feature is available.
11368 */
11369 
11370 uint16_t
11372  DMA_MODULE_ID index ,
11373  DMA_CHANNEL dmaChannel ) ;
11374 //******************************************************************************
11375 /* Function:
11376  uint16_t PLIB_DMA_ChannelXCellSizeGet ( DMA_MODULE_ID index,
11377  DMA_CHANNEL dmaChannel )
11378  Summary:
11379  Reads the cell size (in bytes) configured for the specified channel.
11380  Description:
11381  This function reads the cell size (in bytes) configured for the specified
11382  channel.
11383  Precondition:
11384  None.
11385  Parameters:
11386  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11387  Returns:
11388  - uint16_t - The cell size configured (in bytes) for this channel
11389  The cell size (8-bit, 16-bit) is device-specific. Please refer to the specific
11390  device data sheet to determine availability.
11391  Example:
11392  <code>
11393  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11394  uint16_t cellSize;
11395  cellSize = PLIB_DMA_ChannelXCellSizeGet ( DMA_ID_0,
11396  spiDMAChannel );
11397  </code>
11398  Remarks:
11399  This function implements an operation of the ChannelXCellSize feature.
11400  This feature may not be available on all devices. Please refer to the
11401  specific device data sheet to determine availability or use the
11402  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11403  determine whether this feature is available.
11404 */
11405 
11406 uint16_t
11408  DMA_MODULE_ID index ,
11409  DMA_CHANNEL dmaChannel ) ;
11410 //******************************************************************************
11411 /* Function:
11412  void PLIB_DMA_ChannelXCellSizeSet ( DMA_MODULE_ID index,
11413  DMA_CHANNEL dmaChannel,
11414  uint16_t cellSize)
11415  Summary:
11416  Writes the specified cell size into the register corresponding
11417  to the specified channel.
11418  Description:
11419  This function writes the specified cell size into the register
11420  corresponding to the specified channel.
11421  Precondition:
11422  None.
11423  Parameters:
11424  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11425  cellSize - The cell size in bytes. The cell size (8-bit, 16-bit) is
11426  device-specific. Please refer to the specific device data
11427  sheet to determine availability.)
11428  Returns:
11429  None.
11430  Example:
11431  <code>
11432  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11433  uint16_t cellSize = 0x10;
11434  PLIB_DMA_ChannelXCellSizeSet ( DMA_ID_0, spiDMAChannel, cellSize );
11435  </code>
11436  Remarks:
11437  This function implements an operation of the ChannelXCellSize feature.
11438  This feature may not be available on all devices. Please refer to the
11439  specific device data sheet to determine availability or use the
11440  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11441  determine whether this feature is available.
11442 */
11443 
11444 void
11446  DMA_MODULE_ID index ,
11447  DMA_CHANNEL dmaChannel ,
11448  uint16_t CellSize ) ;
11449 //******************************************************************************
11450 /* Function:
11451  uint16_t PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_MODULE_ID index,
11452  DMA_CHANNEL dmaChannel )
11453  Summary:
11454  Returns the number of bytes transferred since the last event.
11455  Description:
11456  This function returns the number of bytes transferred since the last event.
11457  Precondition:
11458  None.
11459  Parameters:
11460  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11461  Returns:
11462  - uint16_t - The number of bytes transferred since the last event.
11463  The cell progress pointer (8-bit, 16-bit) is device-specific. Please refer to
11464  the specific device data sheet to determine availability.
11465  Example:
11466  <code>
11467  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11468  uint16_t CellProgress;
11469  CellProgress = PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_ID_0,
11470  spiDMAChannel );
11471  </code>
11472  Remarks:
11473  This function implements an operation of the ChannelXCellProgressPointer feature.
11474  This feature may not be available on all devices. Please refer to the
11475  specific device data sheet to determine availability or use the
11476  PLIB_DMA_ExistsChannelXCellProgressPointer function in your application to automatically
11477  determine whether this feature is available.
11478 */
11479 
11480 uint16_t
11482  DMA_MODULE_ID index ,
11483  DMA_CHANNEL dmaChannel ) ;
11484 //******************************************************************************
11485 /* Function:
11486  uint16_t PLIB_DMA_ChannelXPatternDataGet ( DMA_MODULE_ID index,
11487  DMA_CHANNEL dmaChannel )
11488  Summary:
11489  Returns the pattern matching (for DMA abort) data programmed for the specified
11490  channel.
11491  Description:
11492  This function returns pattern matching (for DMA abort) data programmed for
11493  the specified channel.
11494  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11495  the specific device data sheet to determine availability.)
11496  Precondition:
11497  None.
11498  Parameters:
11499  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11500  Returns:
11501  - uint16_t - The pattern matching data programmed for the current channel.
11502  The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11503  the specific device data sheet to determine availability.
11504  Example:
11505  <code>
11506  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11507  uint16_t patternData;
11508  patternData = PLIB_DMA_ChannelXPatternDataGet ( DMA_ID_0, spiDMAChannel );
11509  </code>
11510  Remarks:
11511  This function implements an operation of the ChannelXPatternData feature.
11512  This feature may not be available on all devices. Please refer to the
11513  specific device data sheet to determine availability or use the
11514  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11515  determine whether this feature is available.
11516 */
11517 
11518 uint16_t
11520  DMA_MODULE_ID index ,
11521  DMA_CHANNEL dmaChannel ) ;
11522 //******************************************************************************
11523 /* Function:
11524  void PLIB_DMA_ChannelXPatternDataSet ( DMA_MODULE_ID index,
11525  DMA_CHANNEL dmaChannel,
11526  uint16_t patternData)
11527  Summary:
11528  Writes the specified pattern matching data (for DMA abort) into the register
11529  corresponding to the specified channel.
11530  Description:
11531  This function writes the specified pattern matching data (for DMA abort) into the
11532  register corresponding to the specified channel.
11533  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11534  the specific device data sheet to determine availability.)
11535  Precondition:
11536  None.
11537  Parameters:
11538  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11539  patternData - The pattern matching DATA programmed for the current channel
11540  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11541  the specific device data sheet to determine availability.)
11542  Returns:
11543  None.
11544  Example:
11545  <code>
11546  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11547  uint16_t patternData = '\0';
11548  PLIB_DMA_ChannelXPatternDataSet ( DMA_ID_0, spiDMAChannel, patternData );
11549  </code>
11550  Remarks:
11551  This function implements an operation of the ChannelXPatternData feature.
11552  This feature may not be available on all devices. Please refer to the
11553  specific device data sheet to determine availability or use the
11554  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11555  determine whether this feature is available.
11556 */
11557 
11558 void
11560  DMA_MODULE_ID index ,
11561  DMA_CHANNEL dmaChannel ,
11562  uint16_t patternData ) ;
11563 // *****************************************************************************
11564 // *****************************************************************************
11565 // Section: DMA Interrupt Control Interface functions
11566 // *****************************************************************************
11567 // *****************************************************************************
11568 //******************************************************************************
11569 /* Function:
11570  bool PLIB_DMA_ChannelXINTSourceFlagGet ( DMA_MODULE_ID index,
11571  DMA_CHANNEL dmaChannel,
11572  DMA_INT_TYPE dmaINTSource )
11573  Summary:
11574  Returns the status of the interrupt flag of the specified DMA interrupt source
11575  for the specified channel.
11576  Description:
11577  This function returns the status of the interrupt flag of the specified DMA interrupt
11578  source for the specified channel.
11579  Precondition:
11580  None.
11581  Parameters:
11582  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11583  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11584  Returns:
11585  - true - The interrupt flag is set
11586  - false - The interrupt flag is not set
11587  Example:
11588  <code>
11589  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11590  bool AddressErrorINTStatus;
11591  AddressErrorINTStatus = PLIB_DMA_ChannelXINTSourceFlagGet (
11592  DMA_ID_0,
11593  spiDMAChannel,
11594  DMA_INT_ADDRESS_ERROR );
11595  </code>
11596  Remarks:
11597  This function implements an operation of the ChannelXINTSourceFlag feature.
11598  This feature may not be available on all devices. Please refer to the
11599  specific device data sheet to determine availability or use the
11600  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11601  determine whether this feature is available.
11602 */
11603 
11604 bool
11606  DMA_MODULE_ID index ,
11607  DMA_CHANNEL dmaChannel ,
11608  DMA_INT_TYPE dmaINTSource ) ;
11609 //******************************************************************************
11610 /* Function:
11611  void PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_MODULE_ID index,
11612  DMA_CHANNEL dmaChannel,
11613  DMA_INT_TYPE dmaINTSource )
11614  Summary:
11615  Sets the interrupt flag of the specified DMA interrupt source for the specified channel.
11616  Description:
11617  This function sets the interrupt flag of the specified DMA interrupt source for
11618  the specified channel.
11619  Precondition:
11620  None.
11621  Parameters:
11622  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11623  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11624  Returns:
11625  None.
11626  Example:
11627  <code>
11628  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11629  PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_ID_0,
11630  spiDMAChannel,
11631  DMA_INT_ADDRESS_ERROR );
11632  </code>
11633  Remarks:
11634  This function implements an operation of the ChannelXINTSourceFlag feature.
11635  This feature may not be available on all devices. Please refer to the
11636  specific device data sheet to determine availability or use the
11637  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11638  determine whether this feature is available.
11639 */
11640 
11641 void
11643  DMA_MODULE_ID index ,
11644  DMA_CHANNEL dmaChannel ,
11645  DMA_INT_TYPE dmaINTSource ) ;
11646 //******************************************************************************
11647 /* Function:
11648  void PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_MODULE_ID index,
11649  DMA_CHANNEL dmaChannel,
11650  DMA_INT_TYPE dmaINTSource )
11651  Summary:
11652  Clears the interrupt flag of the specified DMA interrupt source
11653  for the specified channel.
11654  Description:
11655  This function clears the interrupt flag of the specified DMA interrupt source
11656  for the specified channel.
11657  Precondition:
11658  None.
11659  Parameters:
11660  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11661  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11662  Returns:
11663  None.
11664  Example:
11665  <code>
11666  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11667  PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_ID_0,
11668  spiDMAChannel,
11669  DMA_INT_ADDRESS_ERROR );
11670  </code>
11671  Remarks:
11672  This function implements an operation of the ChannelXINTSourceFlag feature.
11673  This feature may not be available on all devices. Please refer to the
11674  specific device data sheet to determine availability or use the
11675  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11676  determine whether this feature is available.
11677 */
11678 
11679 void
11681  DMA_MODULE_ID index ,
11682  DMA_CHANNEL dmaChannel ,
11683  DMA_INT_TYPE dmaINTSource ) ;
11684 //******************************************************************************
11685 /* Function:
11686  void PLIB_DMA_ChannelXINTSourceEnable ( DMA_MODULE_ID index,
11687  DMA_CHANNEL dmaChannel,
11688  DMA_INT_TYPE dmaINTSource )
11689  Summary:
11690  Enables the specified interrupt source for the specified channel.
11691  Description:
11692  This function enables the specified interrupt source for the specified channel.
11693  Precondition:
11694  None.
11695  Parameters:
11696  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11697  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11698  Returns:
11699  None.
11700  Example:
11701  <code>
11702  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11703  PLIB_DMA_ChannelXINTSourceEnable ( DMA_ID_0,
11704  spiDMAChannel,
11705  DMA_INT_ADDRESS_ERROR );
11706  </code>
11707  Remarks:
11708  This function implements an operation of the ChannelXINTSource feature.
11709  This feature may not be available on all devices. Please refer to the
11710  specific device data sheet to determine availability or use the
11711  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11712  determine whether this feature is available.
11713 */
11714 
11715 void
11717  DMA_MODULE_ID index ,
11718  DMA_CHANNEL dmaChannel ,
11719  DMA_INT_TYPE dmaINTSource ) ;
11720 //******************************************************************************
11721 /* Function:
11722  void PLIB_DMA_ChannelXINTSourceDisable ( DMA_MODULE_ID index,
11723  DMA_CHANNEL dmaChannel,
11724  DMA_INT_TYPE dmaINTSource )
11725  Summary:
11726  Disables the specified interrupt source for the specified channel.
11727  Description:
11728  This function disables the specified interrupt source for the specified channel.
11729  Precondition:
11730  None.
11731  Parameters:
11732  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11733  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11734  Returns:
11735  None.
11736  Example:
11737  <code>
11738  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11739  PLIB_DMA_ChannelXINTSourceDisable ( DMA_ID_0,
11740  spiDMAChannel,
11741  DMA_INT_ADDRESS_ERROR );
11742  </code>
11743  Remarks:
11744  This function implements an operation of the ChannelXINTSource feature.
11745  This feature may not be available on all devices. Please refer to the
11746  specific device data sheet to determine availability or use the
11747  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11748  determine whether this feature is available.
11749 */
11750 
11751 void
11753  DMA_MODULE_ID index ,
11754  DMA_CHANNEL dmaChannel ,
11755  DMA_INT_TYPE dmaINTSource ) ;
11756 //******************************************************************************
11757 /* Function:
11758  bool PLIB_DMA_ChannelXINTSourceIsEnabled ( DMA_MODULE_ID index,
11759  DMA_CHANNEL dmaChannel,
11760  DMA_INT_TYPE dmaINTSource )
11761  Summary:
11762  Returns the enable status of the specified interrupt source for the specified channel.
11763  Description:
11764  This function returns the enable status of the specified interrupt source for the
11765  specified channel.
11766  Precondition:
11767  None.
11768  Parameters:
11769  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11770  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11771  Returns:
11772  - true - The interrupt is enabled
11773  - false - The interrupt is not enabled
11774  Example:
11775  <code>
11776  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11777  bool dmaINTSourceEnableStatus;
11778  dmaINTSourceEnableStatus = PLIB_DMA_ChannelXINTSourceIsEnabled (
11779  DMA_ID_0,
11780  spiDMAChannel,
11781  DMA_INT_ADDRESS_ERROR );
11782  </code>
11783  Remarks:
11784  This function implements an operation of the ChannelXINTSource feature.
11785  This feature may not be available on all devices. Please refer to the
11786  specific device data sheet to determine availability or use the
11787  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11788  determine whether this feature is available.
11789 */
11790 
11791 bool
11793  DMA_MODULE_ID index ,
11794  DMA_CHANNEL dmaChannel ,
11795  DMA_INT_TYPE dmaINTSource ) ;
11796 //******************************************************************************
11797 /* Function:
11798  void PLIB_DMA_ChannelXPatternLengthSet( DMA_MODULE_ID index,
11799  DMA_CHANNEL dmaChannel,DMA_PATTERN_LENGTH patternLen )
11800  Summary:
11801  Sets the pattern match length.
11802  Description:
11803  This function sets the length of the pattern match ignore to 1 or 2 bytes.
11804  Precondition:
11805  None.
11806  Parameters:
11807  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11808  patternLen - Length of pattern match (either 1 or 2)
11809  Returns:
11810  None.
11811  Example:
11812  <code>
11813  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11814  DMA_PATTERN_LENGTH patternLen;
11815  patternLen = DMA_PATTERN_MATCH_LENGTH_1BYTE;
11816  PLIB_DMA_ChannelXPatternLengthSet(DMA_ID_0, dmaChannel, patternLen);
11817  </code>
11818  Remarks:
11819  This function implements an operation of the ChannelXPatternLength feature.
11820  This feature may not be available on all devices. Please refer to the
11821  specific device data sheet to determine availability or use the
11822  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
11823  determine whether this feature is available.
11824 */
11825 
11826 void
11828  DMA_MODULE_ID index ,
11829  DMA_CHANNEL dmaChannel ,
11830  DMA_PATTERN_LENGTH patternLen ) ;
11831 //******************************************************************************
11832 /* Function:
11833  DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet( DMA_MODULE_ID index,
11834  DMA_CHANNEL dmaChannel);
11835  Summary:
11836  Returns the pattern match length.
11837  Description:
11838  This function returns the length of the byte matching the CHPIGN bits during a
11839  pattern match that may be ignored during the pattern match determination when
11840  the CHPIGNEN bit is set.
11841  Precondition:
11842  None.
11843  Parameters:
11844  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11845  Returns:
11846  - patternLen - Length of pattern match (either 1 or 2)
11847  Example:
11848  <code>
11849  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11850  DMA_PATTERN_LENGTH patternLen;
11851  patternLen = PLIB_DMA_ChannelXPatternLengthGet(DMA_ID_0, dmaChannel);
11852  </code>
11853  Remarks:
11854  This function implements an operation of the ChannelXPatternLength feature.
11855  This feature may not be available on all devices. Please refer to the
11856  specific device data sheet to determine availability or use the
11857  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
11858  determine whether this feature is available.
11859 */
11860 
11861 DMA_PATTERN_LENGTH
11863  DMA_MODULE_ID index ,
11864  DMA_CHANNEL dmaChannel ) ;
11865 //******************************************************************************
11866 /* Function:
11867  void PLIB_DMA_ChannelXPatternIgnoreByteEnable ( DMA_MODULE_ID index,
11868  DMA_CHANNEL channel );
11869  Summary:
11870  Enables the pattern match ignore byte.
11871  Description:
11872  This function enables the pattern match ignore byte.
11873  Precondition:
11874  None.
11875  Parameters:
11876  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11877  Returns:
11878  None.
11879  Example:
11880  <code>
11881  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11882  PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_ID_0, dmaChannel);
11883  </code>
11884  Remarks:
11885  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11886  This feature may not be available on all devices. Please refer to the
11887  specific device data sheet to determine availability or use the
11888  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11889  determine whether this feature is available.
11890 */
11891 
11892 void
11894  DMA_MODULE_ID index ,
11895  DMA_CHANNEL channel ) ;
11896 //******************************************************************************
11897 /* Function:
11898  bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled ( DMA_MODULE_ID index,
11899  DMA_CHANNEL channel );
11900  Summary:
11901  Returns the state of the pattern match ignore byte.
11902  Description:
11903  This function returns the state (enabled or disabled) of the pattern match
11904  ignore byte.
11905  Precondition:
11906  None.
11907  Parameters:
11908  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11909  Returns:
11910  - true - The pattern match ignore byte is enabled
11911  - false - The pattern match ignore byte is disabled
11912  Example:
11913  <code>
11914  bool patternIsEnabled;
11915  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11916  patternIsEnabled = PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_ID_0, dmaChannel);
11917  </code>
11918  Remarks:
11919  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11920  This feature may not be available on all devices. Please refer to the
11921  specific device data sheet to determine availability or use the
11922  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11923  determine whether this feature is available.
11924 */
11925 
11926 bool
11928  DMA_MODULE_ID index ,
11929  DMA_CHANNEL channel ) ;
11930 //******************************************************************************
11931 /* Function:
11932  void PLIB_DMA_ChannelXPatternIgnoreByteDisable ( DMA_MODULE_ID index,
11933  DMA_CHANNEL channel );
11934  Summary:
11935  Disables the pattern match ignore byte.
11936  Description:
11937  This function disables the pattern match ignore byte.
11938  Precondition:
11939  None.
11940  Parameters:
11941  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11942  Returns:
11943  None.
11944  Example:
11945  <code>
11946  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11947  PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_ID_0, dmaChannel);
11948  </code>
11949  Remarks:
11950  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11951  This feature may not be available on all devices. Please refer to the
11952  specific device data sheet to determine availability or use the
11953  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11954  determine whether this feature is available.
11955 */
11956 
11957 void
11959  DMA_MODULE_ID index ,
11960  DMA_CHANNEL channel ) ;
11961 //******************************************************************************
11962 /* Function:
11963  void PLIB_DMA_ChannelXPatternIgnoreSet (DMA_MODULE_ID index,
11964  DMA_CHANNEL channel, uint8_t pattern );
11965  Summary:
11966  Sets the pattern match ignore value.
11967  Description:
11968  This function sets the value of the pattern match ignore.
11969  Precondition:
11970  None.
11971  Parameters:
11972  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11973  pattern - Pattern match ignore value
11974  Returns:
11975  None.
11976  Example:
11977  <code>
11978  uint8_t patternMatch = 0x8;
11979  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11980  PLIB_DMA_ChannelXPatternIgnoreSet ( DMA_ID_0, dmaChannel,patternMatch);
11981  </code>
11982  Remarks:
11983  This function implements an operation of the ChannelXPatternIgnore feature.
11984  This feature may not be available on all devices. Please refer to the
11985  specific device data sheet to determine availability or use the
11986  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
11987  determine whether this feature is available.
11988 */
11989 
11990 void
11992  DMA_MODULE_ID index ,
11993  DMA_CHANNEL channel ,
11994  uint8_t pattern ) ;
11995 //******************************************************************************
11996 /* Function:
11997  uint8_t PLIB_DMA_ChannelXPatternIgnoreGet( DMA_MODULE_ID index,
11998  DMA_CHANNEL channel );
11999  Summary:
12000  Returns the pattern match ignore value.
12001  Description:
12002  This function returns the value of the pattern match ignore.
12003  Precondition:
12004  None.
12005  Parameters:
12006  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12007  Returns:
12008  - uint8_t - Pattern match ignore value
12009  Example:
12010  <code>
12011  uint8_t patternMatch;
12012  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12013  patternMatch = PLIB_DMA_ChannelXPatternIgnoreGet ( DMA_ID_0, dmaChannel);
12014  </code>
12015  Remarks:
12016  This function implements an operation of the ChannelXPatternIgnore feature.
12017  This feature may not be available on all devices. Please refer to the
12018  specific device data sheet to determine availability or use the
12019  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
12020  determine whether this feature is available.
12021 */
12022 
12023 uint8_t
12025  DMA_MODULE_ID index ,
12026  DMA_CHANNEL channel ) ;
12027 // *****************************************************************************
12028 // *****************************************************************************
12029 // Section: DMA Peripheral Library Exists API Routines
12030 // *****************************************************************************
12031 // *****************************************************************************
12032 /* The following functions indicate the existence of the features on the device.
12033 */
12034 //******************************************************************************
12035 /* Function : PLIB_DMA_ExistsBusy( DMA_MODULE_ID index )
12036  Summary:
12037  Identifies whether the Busy feature exists on the DMA module.
12038  Description:
12039  This function identifies whether the Busy feature is available on the
12040  DMA module.
12041  When this function returns true, these functions are supported on the device:
12042  - PLIB_DMA_BusyActiveSet
12043  - PLIB_DMA_BusyActiveReset
12044  - PLIB_DMA_IsBusy
12045  Preconditions:
12046  None.
12047  Parameters:
12048  index - Identifier for the device instance
12049  Returns:
12050  - true - The Busy feature is supported on the device
12051  - false - The Busy feature is not supported on the device
12052  Remarks:
12053  None.
12054 */
12055 
12056 bool
12058  DMA_MODULE_ID index ) ;
12059 //******************************************************************************
12060 /* Function : PLIB_DMA_ExistsSuspend( DMA_MODULE_ID index )
12061  Summary:
12062  Identifies whether the Suspend feature exists on the DMA module.
12063  Description:
12064  This function identifies whether the Suspend feature is available on the
12065  DMA module.
12066  When this function returns true, these functions are supported on the device:
12067  - PLIB_DMA_SuspendEnable
12068  - PLIB_DMA_SuspendDisable
12069  - PLIB_DMA_SuspendIsEnabled
12070  Preconditions:
12071  None.
12072  Parameters:
12073  index - Identifier for the device instance
12074  Returns:
12075  - true - The Suspend feature is supported on the device
12076  - false - The Suspend feature is not supported on the device
12077  Remarks:
12078  None.
12079 */
12080 
12081 bool
12083  DMA_MODULE_ID index ) ;
12084 //******************************************************************************
12085 /* Function : PLIB_DMA_ExistsStopInIdle( DMA_MODULE_ID index )
12086  Summary:
12087  Identifies whether the StopInIdle feature exists on the DMA module.
12088  Description:
12089  This function identifies whether the StopInIdle feature is available on the
12090  DMA module.
12091  When this function returns true, these functions are supported on the device:
12092  - PLIB_DMA_StopInIdleEnable
12093  - PLIB_DMA_StopInIdleDisable
12094  Preconditions:
12095  None.
12096  Parameters:
12097  index - Identifier for the device instance
12098  Returns:
12099  - true - The StopInIdle feature is supported on the device
12100  - false - The StopInIdle feature is not supported on the device
12101  Remarks:
12102  None.
12103 */
12104 
12105 bool
12107  DMA_MODULE_ID index ) ;
12108 //******************************************************************************
12109 /* Function : PLIB_DMA_ExistsEnableControl( DMA_MODULE_ID index )
12110  Summary:
12111  Identifies whether the EnableControl feature exists on the DMA module.
12112  Description:
12113  This function identifies whether the EnableControl feature is available on
12114  the DMA module.
12115  When this function returns true, these functions are supported on the device:
12116  - PLIB_DMA_Enable
12117  - PLIB_DMA_Disable
12118  - PLIB_DMA_IsEnabled
12119  Preconditions:
12120  None.
12121  Parameters:
12122  index - Identifier for the device instance
12123  Returns:
12124  - true - The EnableControl feature is supported on the device
12125  - false - The EnableControl feature is not supported on the device
12126  Remarks:
12127  None.
12128 */
12129 
12130 bool
12132  DMA_MODULE_ID index ) ;
12133 //******************************************************************************
12134 /* Function : PLIB_DMA_ExistsChannelBits( DMA_MODULE_ID index )
12135  Summary:
12136  Identifies whether the ChannelBits feature exists on the DMA module.
12137  Description:
12138  This function identifies whether the ChannelBits feature is available on the
12139  DMA module.
12140  When this function returns true, this function is supported on the device:
12141  - PLIB_DMA_ChannelBitsGet
12142  Preconditions:
12143  None.
12144  Parameters:
12145  index - Identifier for the device instance
12146  Returns:
12147  - true - The ChannelBits feature is supported on the device
12148  - false - The ChannelBits feature is not supported on the device
12149  Remarks:
12150  None.
12151 */
12152 
12153 bool
12155  DMA_MODULE_ID index ) ;
12156 //******************************************************************************
12157 /* Function : PLIB_DMA_ExistsLastBusAccess( DMA_MODULE_ID index )
12158  Summary:
12159  Identifies whether the LastBusAccess feature exists on the DMA module.
12160  Description:
12161  This function identifies whether the LastBusAccess feature is available on the
12162  DMA module.
12163  When this function returns true, these functions are supported on the device:
12164  - PLIB_DMA_LastBusAccessIsRead
12165  - PLIB_DMA_LastBusAccessIsWrite
12166  Preconditions:
12167  None.
12168  Parameters:
12169  index - Identifier for the device instance
12170  Returns:
12171  - true - The LastBusAccess feature is supported on the device
12172  - false - The LastBusAccess feature is not supported on the device
12173  Remarks:
12174  None.
12175 */
12176 
12177 bool
12179  DMA_MODULE_ID index ) ;
12180 //******************************************************************************
12181 /* Function : PLIB_DMA_ExistsRecentAddress( DMA_MODULE_ID index )
12182  Summary:
12183  Identifies whether the RecentAddress feature exists on the DMA module.
12184  Description:
12185  This function identifies whether the RecentAddress feature is available on
12186  the DMA module.
12187  When this function returns true, this function is supported on the device:
12188  - PLIB_DMA_RecentAddressAccessed
12189  Preconditions:
12190  None.
12191  Parameters:
12192  index - Identifier for the device instance
12193  Returns:
12194  - true - The RecentAddress feature is supported on the device
12195  - false - The RecentAddress feature is not supported on the device
12196  Remarks:
12197  None.
12198 */
12199 
12200 bool
12202  DMA_MODULE_ID index ) ;
12203 //******************************************************************************
12204 /* Function : PLIB_DMA_ExistsCRCChannel( DMA_MODULE_ID index )
12205  Summary:
12206  Identifies whether the CRCChannel feature exists on the DMA module.
12207  Description:
12208  This function identifies whether the CRCChannel feature is available on the
12209  DMA module.
12210  When this function returns true, these functions are supported on the device:
12211  - PLIB_DMA_CRCChannelSelect
12212  - PLIB_DMA_CRCChannelGet
12213  Preconditions:
12214  None.
12215  Parameters:
12216  index - Identifier for the device instance
12217  Returns:
12218  - true - The CRCChannel feature is supported on the device
12219  - false - The CRCChannel feature is not supported on the device
12220  Remarks:
12221  None.
12222 */
12223 
12224 bool
12226  DMA_MODULE_ID index ) ;
12227 //******************************************************************************
12228 /* Function : PLIB_DMA_ExistsCRCType( DMA_MODULE_ID index )
12229  Summary:
12230  Identifies whether the CRCType feature exists on the DMA module.
12231  Description:
12232  This function identifies whether the CRCType feature is available on the
12233  DMA module.
12234  When this function returns true, these functions are supported on the device:
12235  - PLIB_DMA_CRCTypeGet
12236  - PLIB_DMA_CRCTypeSet
12237  Preconditions:
12238  None.
12239  Parameters:
12240  index - Identifier for the device instance
12241  Returns:
12242  - true - The CRCType feature is supported on the device
12243  - false - The CRCType feature is not supported on the device
12244  Remarks:
12245  None.
12246 */
12247 
12248 bool
12250  DMA_MODULE_ID index ) ;
12251 //******************************************************************************
12252 /* Function : PLIB_DMA_ExistsCRCAppendMode( DMA_MODULE_ID index )
12253  Summary:
12254  Identifies whether the CRCAppendMode feature exists on the DMA module.
12255  Description:
12256  This function identifies whether the CRCAppendMode feature is available on
12257  the DMA module.
12258  When this function returns true, these functions are supported on the device:
12259  - PLIB_DMA_CRCAppendModeEnable
12260  - PLIB_DMA_CRCAppendModeDisable
12261  - PLIB_DMA_CRCAppendModeIsEnabled
12262  Preconditions:
12263  None.
12264  Parameters:
12265  index - Identifier for the device instance
12266  Returns:
12267  - true - The CRCAppendMode feature is supported on the device
12268  - false - The CRCAppendMode feature is not supported on the device
12269  Remarks:
12270  None.
12271 */
12272 
12273 bool
12275  DMA_MODULE_ID index ) ;
12276 //******************************************************************************
12277 /* Function : PLIB_DMA_ExistsCRC( DMA_MODULE_ID index )
12278  Summary:
12279  Identifies whether the CRC feature exists on the DMA module.
12280  Description:
12281  This function identifies whether the CRC feature is available on the DMA module.
12282  When this function returns true, these functions are supported on the device:
12283  - PLIB_DMA_CRCEnable
12284  - PLIB_DMA_CRCDisable
12285  - PLIB_DMA_CRCIsEnabled
12286  Preconditions:
12287  None.
12288  Parameters:
12289  index - Identifier for the device instance
12290  Returns:
12291  - true - The CRC feature is supported on the device
12292  - false - The CRC feature is not supported on the device
12293  Remarks:
12294  None.
12295 */
12296 
12297 bool
12299  DMA_MODULE_ID index ) ;
12300 //******************************************************************************
12301 /* Function : PLIB_DMA_ExistsCRCPolynomialLength( DMA_MODULE_ID index )
12302  Summary:
12303  Identifies whether the CRCPolynomialLength feature exists on the DMA module.
12304  Description:
12305  This function identifies whether the CRCPolynomialLength feature is available
12306  on the DMA module.
12307  When this function returns true, these functions are supported on the device:
12308  - PLIB_DMA_CRCPolynomialLengthSet
12309  - PLIB_DMA_CRCPolynomialLengthGet
12310  Preconditions:
12311  None.
12312  Parameters:
12313  index - Identifier for the device instance
12314  Returns:
12315  - true - The CRCPolynomialLength feature is supported on the device
12316  - false - The CRCPolynomialLength feature is not supported on the device
12317  Remarks:
12318  None.
12319 */
12320 
12321 bool
12323  DMA_MODULE_ID index ) ;
12324 //******************************************************************************
12325 /* Function : PLIB_DMA_ExistsCRCBitOrder( DMA_MODULE_ID index )
12326  Summary:
12327  Identifies whether the CRCBitOrder feature exists on the DMA module.
12328  Description:
12329  This function identifies whether the CRCBitOrder feature is available on the
12330  DMA module.
12331  When this function returns true, this function is supported on the device:
12332  - PLIB_DMA_CRCBitOrderSelect
12333  Preconditions:
12334  None.
12335  Parameters:
12336  index - Identifier for the device instance
12337  Returns:
12338  - true - The CRCBitOrder feature is supported on the device
12339  - false - The CRCBitOrder feature is not supported on the device
12340  Remarks:
12341  None.
12342 */
12343 
12344 bool
12346  DMA_MODULE_ID index ) ;
12347 //******************************************************************************
12348 /* Function : PLIB_DMA_ExistsCRCWriteByteOrder( DMA_MODULE_ID index )
12349  Summary:
12350  Identifies whether the CRCWriteByteOrder feature exists on the DMA module.
12351  Description:
12352  This function identifies whether the CRCWriteByteOrder feature is available
12353  on the DMA module.
12354  When this function returns true, these functions are supported on the device:
12355  - PLIB_DMA_CRCWriteByteOrderAlter
12356  - PLIB_DMA_CRCWriteByteOrderMaintain
12357  Preconditions:
12358  None.
12359  Parameters:
12360  index - Identifier for the device instance
12361  Returns:
12362  - true - The CRCWriteByteOrder feature is supported on the device
12363  - false - The CRCWriteByteOrder feature is not supported on the device
12364  Remarks:
12365  None.
12366 */
12367 
12368 bool
12370  DMA_MODULE_ID index ) ;
12371 //******************************************************************************
12372 /* Function : PLIB_DMA_ExistsCRCByteOrder( DMA_MODULE_ID index )
12373  Summary:
12374  Identifies whether the CRCByteOrder feature exists on the DMA module.
12375  Description:
12376  This function identifies whether the CRCByteOrder feature is available on
12377  the DMA module.
12378  When this function returns true, these functions are supported on the device:
12379  - PLIB_DMA_CRCByteOrderSelect
12380  - PLIB_DMA_CRCByteOrderGet
12381  Preconditions:
12382  None.
12383  Parameters:
12384  index - Identifier for the device instance
12385  Returns:
12386  - true - The CRCByteOrder feature is supported on the device
12387  - false - The CRCByteOrder feature is not supported on the device
12388  Remarks:
12389  None.
12390 */
12391 
12392 bool
12394  DMA_MODULE_ID index ) ;
12395 //******************************************************************************
12396 /* Function : PLIB_DMA_ExistsCRCData( DMA_MODULE_ID index )
12397  Summary:
12398  Identifies whether the CRCData feature exists on the DMA module.
12399  Description:
12400  This function identifies whether the CRCData feature is available on the
12401  DMA module.
12402  When this function returns true, these functions are supported on the device:
12403  - PLIB_DMA_CRCDataRead
12404  - PLIB_DMA_CRCDataWrite
12405  Preconditions:
12406  None.
12407  Parameters:
12408  index - Identifier for the device instance
12409  Returns:
12410  - true - The CRCData feature is supported on the device
12411  - false - The CRCData feature is not supported on the device
12412  Remarks:
12413  None.
12414 */
12415 
12416 bool
12418  DMA_MODULE_ID index ) ;
12419 //******************************************************************************
12420 /* Function : PLIB_DMA_ExistsCRCXOREnable( DMA_MODULE_ID index )
12421  Summary:
12422  Identifies whether the CRCXOREnable feature exists on the DMA module.
12423  Description:
12424  This function identifies whether the CRCXOREnable feature is available on the
12425  DMA module.
12426  When this function returns true, these functions are supported on the device:
12427  - PLIB_DMA_CRCXOREnableSet
12428  - PLIB_DMA_CRCXOREnableGet
12429  Preconditions:
12430  None.
12431  Parameters:
12432  index - Identifier for the device instance
12433  Returns:
12434  - true - The CRCXOREnable feature is supported on the device
12435  - false - The CRCXOREnable feature is not supported on the device
12436  Remarks:
12437  None.
12438 */
12439 
12440 bool
12442  DMA_MODULE_ID index ) ;
12443 //******************************************************************************
12444 /* Function : PLIB_DMA_ExistsChannelXPriority( DMA_MODULE_ID index )
12445  Summary:
12446  Identifies whether the ChannelXPriority feature exists on the DMA module.
12447  Description:
12448  This function identifies whether the ChannelXPriority feature is available on
12449  the DMA module.
12450  When this function returns true, these functions are supported on the device:
12451  - PLIB_DMA_ChannelXPrioritySelect
12452  - PLIB_DMA_ChannelXPriorityGet
12453  Preconditions:
12454  None.
12455  Parameters:
12456  index - Identifier for the device instance
12457  Returns:
12458  - true - The ChannelXPriority feature is supported on the device
12459  - false - The ChannelXPriority feature is not supported on the device
12460  Remarks:
12461  None.
12462 */
12463 
12464 bool
12466  DMA_MODULE_ID index ) ;
12467 //******************************************************************************
12468 /* Function : PLIB_DMA_ExistsChannelXEvent( DMA_MODULE_ID index )
12469  Summary:
12470  Identifies whether the ChannelXEvent feature exists on the DMA module.
12471  Description:
12472  This function identifies whether the ChannelXEvent feature is available on
12473  the DMA module.
12474  When this function returns true, this function is supported on the device:
12475  - PLIB_DMA_ChannelXEventIsDetected
12476  Preconditions:
12477  None.
12478  Parameters:
12479  index - Identifier for the device instance
12480  Returns:
12481  - true - The ChannelXEvent feature is supported on the device
12482  - false - The ChannelXEvent feature is not supported on the device
12483  Remarks:
12484  None.
12485 */
12486 
12487 bool
12489  DMA_MODULE_ID index ) ;
12490 //******************************************************************************
12491 /* Function : PLIB_DMA_ExistsChannelXAuto( DMA_MODULE_ID index )
12492  Summary:
12493  Identifies whether the ChannelXAuto feature exists on the DMA module.
12494  Description:
12495  This function identifies whether the ChannelXAuto feature is available on
12496  the DMA module.
12497  When this function returns true, these functions are supported on the device:
12498  - PLIB_DMA_ChannelXAutoEnable
12499  - PLIB_DMA_ChannelXAutoDisable
12500  - PLIB_DMA_ChannelXAutoIsEnabled
12501  Preconditions:
12502  None.
12503  Parameters:
12504  index - Identifier for the device instance
12505  Returns:
12506  - true - The ChannelXAuto feature is supported on the device
12507  - false - The ChannelXAuto feature is not supported on the device
12508  Remarks:
12509  None.
12510 */
12511 
12512 bool
12514  DMA_MODULE_ID index ) ;
12515 //******************************************************************************
12516 /* Function : PLIB_DMA_ExistsChannelXChainEnbl( DMA_MODULE_ID index )
12517  Summary:
12518  Identifies whether the ChannelXChainEnbl feature exists on the DMA module.
12519  Description:
12520  This function identifies whether the ChannelXChainEnbl feature is available
12521  on the DMA module.
12522  When this function returns true, these functions are supported on the device:
12523  - PLIB_DMA_ChannelXChainEnable
12524  - PLIB_DMA_ChannelXChainDisable
12525  - PLIB_DMA_ChannelXChainIsEnabled
12526  Preconditions:
12527  None.
12528  Parameters:
12529  index - Identifier for the device instance
12530  Returns:
12531  - true - The ChannelXChainEnbl feature is supported on the device
12532  - false - The ChannelXChainEnbl feature is not supported on the device
12533  Remarks:
12534  None.
12535 */
12536 
12537 bool
12539  DMA_MODULE_ID index ) ;
12540 //******************************************************************************
12541 /* Function : PLIB_DMA_ExistsChannelXDisabled( DMA_MODULE_ID index )
12542  Summary:
12543  Identifies whether the ChannelXDisabled feature exists on the DMA module.
12544  Description:
12545  This function identifies whether the ChannelXDisabled feature is available
12546  on the DMA module.
12547  When this function returns true, these functions are supported on the device:
12548  - PLIB_DMA_ChannelXDisabledEnablesEvents
12549  - PLIB_DMA_ChannelXDisabledDisablesEvents
12550  Preconditions:
12551  None.
12552  Parameters:
12553  index - Identifier for the device instance
12554  Returns:
12555  - true - The ChannelXDisabled feature is supported on the device
12556  - false - The ChannelXDisabled feature is not supported on the device
12557  Remarks:
12558  None.
12559 */
12560 
12561 bool
12563  DMA_MODULE_ID index ) ;
12564 //******************************************************************************
12565 /* Function : PLIB_DMA_ExistsChannelX( DMA_MODULE_ID index )
12566  Summary:
12567  Identifies whether the ChannelX feature exists on the DMA module.
12568  Description:
12569  This function identifies whether the ChannelX feature is available on the
12570  DMA module.
12571  When this function returns true, these functions are supported on the device:
12572  - PLIB_DMA_ChannelXEnable
12573  - PLIB_DMA_ChannelXIsEnabled
12574  - PLIB_DMA_ChannelXDisable
12575  Preconditions:
12576  None.
12577  Parameters:
12578  index - Identifier for the device instance
12579  Returns:
12580  - true - The ChannelX feature is supported on the device
12581  - false - The ChannelX feature is not supported on the device
12582  Remarks:
12583  None.
12584 */
12585 
12586 bool
12588  DMA_MODULE_ID index ) ;
12589 //******************************************************************************
12590 /* Function : PLIB_DMA_ExistsChannelXChain( DMA_MODULE_ID index )
12591  Summary:
12592  Identifies whether the ChannelXChain feature exists on the DMA module.
12593  Description:
12594  This function identifies whether the ChannelXChain feature is available on the
12595  DMA module.
12596  When this function returns true, these functions are supported on the device:
12597  - PLIB_DMA_ChannelXChainToLower
12598  - PLIB_DMA_ChannelXChainToHigher
12599  Preconditions:
12600  None.
12601  Parameters:
12602  index - Identifier for the device instance
12603  Returns:
12604  - true - The ChannelXChain feature is supported on the device
12605  - false - The ChannelXChain feature is not supported on the device
12606  Remarks:
12607  None.
12608 */
12609 
12610 bool
12612  DMA_MODULE_ID index ) ;
12613 //******************************************************************************
12614 /* Function : PLIB_DMA_ExistsChannelXPatternLength( DMA_MODULE_ID index )
12615  Summary:
12616  Identifies whether the ChannelXPatternLength feature exists on the DMA module.
12617  Description:
12618  This function identifies whether the ChannelXPatternLength feature is available
12619  on the DMA module.
12620  When this function returns true, these functions are supported on the device:
12621  - PLIB_DMA_ChannelXPatternLengthSet
12622  - PLIB_DMA_ChannelXPatternLengthGet
12623  Preconditions:
12624  None.
12625  Parameters:
12626  index - Identifier for the device instance
12627  Returns:
12628  - true - The ChannelXPatternLength feature is supported on the device
12629  - false - The ChannelXPatternLength feature is not supported on the device
12630  Remarks:
12631  None.
12632 */
12633 
12634 bool
12636  DMA_MODULE_ID index ) ;
12637 //******************************************************************************
12638 /* Function : PLIB_DMA_ExistsChannelXPatternIgnoreByte( DMA_MODULE_ID index )
12639  Summary:
12640  Identifies whether the ChannelXPatternIgnoreByte feature exists on the DMA
12641  module.
12642  Description:
12643  This function identifies whether the ChannelXPatternIgnoreByte feature is
12644  available on the DMA module.
12645  When this function returns true, these functions are supported on the device:
12646  - PLIB_DMA_ChannelXPatternIgnoreByteEnable
12647  - PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled
12648  - PLIB_DMA_ChannelXPatternIgnoreByteDisable
12649  Preconditions:
12650  None.
12651  Parameters:
12652  index - Identifier for the device instance
12653  Returns:
12654  - true - The ChannelXPatternIgnoreByte feature is supported on the device
12655  - false - The ChannelXPatternIgnoreByte feature is not supported on the device
12656  Remarks:
12657  None.
12658 */
12659 
12660 bool
12662  DMA_MODULE_ID index ) ;
12663 //******************************************************************************
12664 /* Function : PLIB_DMA_ExistsChannelXBusy( DMA_MODULE_ID index )
12665  Summary:
12666  Identifies whether the ChannelXBusy feature exists on the DMA module.
12667  Description:
12668  This function identifies whether the ChannelXBusy feature is available on the
12669  DMA module.
12670  When this function returns true, these functions are supported on the device:
12671  - PLIB_DMA_ChannelXBusyActiveSet
12672  - PLIB_DMA_ChannelXBusyInActiveSet
12673  - PLIB_DMA_ChannelXBusyIsBusy
12674  Preconditions:
12675  None.
12676  Parameters:
12677  index - Identifier for the device instance
12678  Returns:
12679  - true - The ChannelXBusy feature is supported on the device
12680  - false - The ChannelXBusy feature is not supported on the device
12681  Remarks:
12682  None.
12683 */
12684 
12685 bool
12687  DMA_MODULE_ID index ) ;
12688 //******************************************************************************
12689 /* Function : PLIB_DMA_ExistsChannelXPatternIgnore( DMA_MODULE_ID index )
12690  Summary:
12691  Identifies whether the ChannelXPatternIgnore feature exists on the DMA module.
12692  Description:
12693  This function identifies whether the ChannelXPatternIgnore feature is available
12694  on the DMA module.
12695  When this function returns true, these functions are supported on the device:
12696  - PLIB_DMA_ChannelXPatternIgnoreSet
12697  - PLIB_DMA_ChannelXPatternIgnoreGet
12698  Preconditions:
12699  None.
12700  Parameters:
12701  index - Identifier for the device instance
12702  Returns:
12703  - true - The ChannelXPatternIgnore feature is supported on the device
12704  - false - The ChannelXPatternIgnore feature is not supported on the device
12705  Remarks:
12706  None.
12707 */
12708 
12709 bool
12711  DMA_MODULE_ID index ) ;
12712 //******************************************************************************
12713 /* Function : PLIB_DMA_ExistsChannelXTrigger( DMA_MODULE_ID index )
12714  Summary:
12715  Identifies whether the ChannelXTrigger feature exists on the DMA module.
12716  Description:
12717  This function identifies whether the ChannelXTrigger feature is available on
12718  the DMA module.
12719  When this function returns true, these functions are supported on the device:
12720  - PLIB_DMA_ChannelXTriggerEnable
12721  - PLIB_DMA_ChannelXTriggerIsEnabled
12722  - PLIB_DMA_ChannelXTriggerDisable
12723  Preconditions:
12724  None.
12725  Parameters:
12726  index - Identifier for the device instance
12727  Returns:
12728  - true - The ChannelXTrigger feature is supported on the device
12729  - false - The ChannelXTrigger feature is not supported on the device
12730  Remarks:
12731  None.
12732 */
12733 
12734 bool
12736  DMA_MODULE_ID index ) ;
12737 //******************************************************************************
12738 /* Function : PLIB_DMA_ExistsAbortTransfer( DMA_MODULE_ID index )
12739  Summary:
12740  Identifies whether the AbortTransfer feature exists on the DMA module.
12741  Description:
12742  This function identifies whether the AbortTransfer feature is available on
12743  the DMA module.
12744  When this function returns true, this function is supported on the device:
12745  - PLIB_DMA_AbortTransferSet
12746  Preconditions:
12747  None.
12748  Parameters:
12749  index - Identifier for the device instance
12750  Returns:
12751  - true - The AbortTransfer feature is supported on the device
12752  - false - The AbortTransfer feature is not supported on the device
12753  Remarks:
12754  None.
12755 */
12756 
12757 bool
12759  DMA_MODULE_ID index ) ;
12760 //******************************************************************************
12761 /* Function : PLIB_DMA_ExistsStartTransfer( DMA_MODULE_ID index )
12762  Summary:
12763  Identifies whether the StartTransfer feature exists on the DMA module.
12764  Description:
12765  This function identifies whether the StartTransfer feature is available on
12766  the DMA module.
12767  When this function returns true, this function is supported on the device:
12768  - PLIB_DMA_StartTransferSet
12769  Preconditions:
12770  None.
12771  Parameters:
12772  index - Identifier for the device instance
12773  Returns:
12774  - true - The StartTransfer feature is supported on the device
12775  - false - The StartTransfer feature is not supported on the device
12776  Remarks:
12777  None.
12778 */
12779 
12780 bool
12782  DMA_MODULE_ID index ) ;
12783 //******************************************************************************
12784 /* Function : PLIB_DMA_ExistsChannelXStartIRQ( DMA_MODULE_ID index )
12785  Summary:
12786  Identifies whether the ChannelXStartIRQ feature exists on the DMA module.
12787  Description:
12788  This function identifies whether the ChannelXStartIRQ feature is available
12789  on the DMA module.
12790  When this function returns true, this function is supported on the device:
12791  - PLIB_DMA_ChannelXStartIRQSet
12792  Preconditions:
12793  None.
12794  Parameters:
12795  index - Identifier for the device instance
12796  Returns:
12797  - true - The ChannelXStartIRQ feature is supported on the device
12798  - false - The ChannelXStartIRQ feature is not supported on the device
12799  Remarks:
12800  None.
12801 */
12802 
12803 bool
12805  DMA_MODULE_ID index ) ;
12806 //******************************************************************************
12807 /* Function : PLIB_DMA_ExistsChannelXAbortIRQ( DMA_MODULE_ID index )
12808  Summary:
12809  Identifies whether the ChannelXAbortIRQ feature exists on the DMA module.
12810  Description:
12811  This function identifies whether the ChannelXAbortIRQ feature is available
12812  on the DMA module.
12813  When this function returns true, this function is supported on the device:
12814  - PLIB_DMA_ChannelXAbortIRQSet
12815  Preconditions:
12816  None.
12817  Parameters:
12818  index - Identifier for the device instance
12819  Returns:
12820  - true - The ChannelXAbortIRQ feature is supported on the device
12821  - false - The ChannelXAbortIRQ feature is not supported on the device
12822  Remarks:
12823  None.
12824 */
12825 
12826 bool
12828  DMA_MODULE_ID index ) ;
12829 //******************************************************************************
12830 /* Function : PLIB_DMA_ExistsChannelXINTSourceFlag( DMA_MODULE_ID index )
12831  Summary:
12832  Identifies whether the ChannelXINTSourceFlag feature exists on the DMA module.
12833  Description:
12834  This function identifies whether the ChannelXINTSourceFlag feature is available
12835  on the DMA module.
12836  When this function returns true, these functions are supported on the device:
12837  - PLIB_DMA_ChannelXINTSourceFlagGet
12838  - PLIB_DMA_ChannelXINTSourceFlagSet
12839  - PLIB_DMA_ChannelXINTSourceFlagClear
12840  Preconditions:
12841  None.
12842  Parameters:
12843  index - Identifier for the device instance
12844  Returns:
12845  - true - The ChannelXINTSourceFlag feature is supported on the device
12846  - false - The ChannelXINTSourceFlag feature is not supported on the device
12847  Remarks:
12848  None.
12849 */
12850 
12851 bool
12853  DMA_MODULE_ID index ) ;
12854 //******************************************************************************
12855 /* Function : PLIB_DMA_ExistsChannelXINTSource( DMA_MODULE_ID index )
12856  Summary:
12857  Identifies whether the ChannelXINTSource feature exists on the DMA module.
12858  Description:
12859  This function identifies whether the ChannelXINTSource feature is available
12860  on the DMA module.
12861  When this function returns true, these functions are supported on the device:
12862  - PLIB_DMA_ChannelXINTSourceEnable
12863  - PLIB_DMA_ChannelXINTSourceDisable
12864  - PLIB_DMA_ChannelXINTSourceIsEnabled
12865  Preconditions:
12866  None.
12867  Parameters:
12868  index - Identifier for the device instance
12869  Returns:
12870  - true - The ChannelXINTSource feature is supported on the device
12871  - false - The ChannelXINTSource feature is not supported on the device
12872  Remarks:
12873  None.
12874 */
12875 
12876 bool
12878  DMA_MODULE_ID index ) ;
12879 //******************************************************************************
12880 /* Function : PLIB_DMA_ExistsChannelXSourceStartAddress( DMA_MODULE_ID index )
12881  Summary:
12882  Identifies whether the ChannelXSourceStartAddress feature exists on the DMA module.
12883  Description:
12884  This function identifies whether the ChannelXSourceStartAddress feature is available
12885  on the DMA module.
12886  When this function returns true, these functions are supported on the device:
12887  - PLIB_DMA_ChannelXSourceStartAddressGet
12888  - PLIB_DMA_ChannelXSourceStartAddressSet
12889  Preconditions:
12890  None.
12891  Parameters:
12892  index - Identifier for the device instance
12893  Returns:
12894  - true - The ChannelXSourceStartAddress feature is supported on the device
12895  - false - The ChannelXSourceStartAddress feature is not supported on the device
12896  Remarks:
12897  None.
12898 */
12899 
12900 bool
12902  DMA_MODULE_ID index ) ;
12903 //******************************************************************************
12904 /* Function : PLIB_DMA_ExistsChannelXDestinationStartAddress( DMA_MODULE_ID index )
12905  Summary:
12906  Identifies whether the ChannelXDestinationStartAddress feature exists on
12907  the DMA module.
12908  Description:
12909  This function identifies whether the ChannelXDestinationStartAddress feature
12910  is available on the DMA module.
12911  When this function returns true, these functions are supported on the device:
12912  - PLIB_DMA_ChannelXDestinationStartAddressGet
12913  - PLIB_DMA_ChannelXDestinationStartAddressSet
12914  Preconditions:
12915  None.
12916  Parameters:
12917  index - Identifier for the device instance
12918  Returns:
12919  - true - The ChannelXDestinationStartAddress feature is supported on the device
12920  - false - The ChannelXDestinationStartAddress feature is not supported on the device
12921  Remarks:
12922  None.
12923 */
12924 
12925 bool
12927  DMA_MODULE_ID index ) ;
12928 //******************************************************************************
12929 /* Function : PLIB_DMA_ExistsChannelXSourceSize( DMA_MODULE_ID index )
12930  Summary:
12931  Identifies whether the ChannelXSourceSize feature exists on the DMA module.
12932  Description:
12933  This function identifies whether the ChannelXSourceSize feature is available
12934  on the DMA module.
12935  When this function returns true, these functions are supported on the device:
12936  - PLIB_DMA_ChannelXSourceSizeGet
12937  - PLIB_DMA_ChannelXSourceSizeSet
12938  Preconditions:
12939  None.
12940  Parameters:
12941  index - Identifier for the device instance
12942  Returns:
12943  - true - The ChannelXSourceSize feature is supported on the device
12944  - false - The ChannelXSourceSize feature is not supported on the device
12945  Remarks:
12946  None.
12947 */
12948 
12949 bool
12951  DMA_MODULE_ID index ) ;
12952 //******************************************************************************
12953 /* Function : PLIB_DMA_ExistsChannelXDestinationSize( DMA_MODULE_ID index )
12954  Summary:
12955  Identifies whether the ChannelXDestinationSize feature exists on the DMA module.
12956  Description:
12957  This function identifies whether the ChannelXDestinationSize feature is available
12958  on the DMA module.
12959  When this function returns true, these functions are supported on the device:
12960  - PLIB_DMA_ChannelXDestinationSizeGet
12961  - PLIB_DMA_ChannelXDestinationSizeSet
12962  Preconditions:
12963  None.
12964  Parameters:
12965  index - Identifier for the device instance
12966  Returns:
12967  - true - The ChannelXDestinationSize feature is supported on the device
12968  - false - The ChannelXDestinationSize feature is not supported on the device
12969  Remarks:
12970  None.
12971 */
12972 
12973 bool
12975  DMA_MODULE_ID index ) ;
12976 //******************************************************************************
12977 /* Function : PLIB_DMA_ExistsChannelXSourcePointer( DMA_MODULE_ID index )
12978  Summary:
12979  Identifies whether the ChannelXSourcePointer feature exists on the DMA module.
12980  Description:
12981  This function identifies whether the ChannelXSourcePointer feature is available
12982  on the DMA module.
12983  When this function returns true, this function is supported on the device:
12984  - PLIB_DMA_ChannelXSourcePointerGet
12985  Preconditions:
12986  None.
12987  Parameters:
12988  index - Identifier for the device instance
12989  Returns:
12990  - true - The ChannelXSourcePointer feature is supported on the device
12991  - false - The ChannelXSourcePointer feature is not supported on the device
12992  Remarks:
12993  None.
12994 */
12995 
12996 bool
12998  DMA_MODULE_ID index ) ;
12999 //******************************************************************************
13000 /* Function : PLIB_DMA_ExistsChannelXDestinationPointer( DMA_MODULE_ID index )
13001  Summary:
13002  Identifies whether the ChannelXDestinationPointer feature exists on the DMA module.
13003  Description:
13004  This function identifies whether the ChannelXDestinationPointer feature is available
13005  on the DMA module.
13006  When this function returns true, this function is supported on the device:
13007  - PLIB_DMA_ChannelXDestinationPointerGet
13008  Preconditions:
13009  None.
13010  Parameters:
13011  index - Identifier for the device instance
13012  Returns:
13013  - true - The ChannelXDestinationPointer feature is supported on the device
13014  - false - The ChannelXDestinationPointer feature is not supported on the device
13015  Remarks:
13016  None.
13017 */
13018 
13019 bool
13021  DMA_MODULE_ID index ) ;
13022 //******************************************************************************
13023 /* Function : PLIB_DMA_ExistsChannelXCellSize( DMA_MODULE_ID index )
13024  Summary:
13025  Identifies whether the ChannelXCellSize feature exists on the DMA module.
13026  Description:
13027  This function identifies whether the ChannelXCellSize feature is available on
13028  the DMA module.
13029  When this function returns true, these functions are supported on the device:
13030  - PLIB_DMA_ChannelXCellSizeGet
13031  - PLIB_DMA_ChannelXCellSizeSet
13032  Preconditions:
13033  None.
13034  Parameters:
13035  index - Identifier for the device instance
13036  Returns:
13037  - true - The ChannelXCellSize feature is supported on the device
13038  - false - The ChannelXCellSize feature is not supported on the device
13039  Remarks:
13040  None.
13041 */
13042 
13043 bool
13045  DMA_MODULE_ID index ) ;
13046 //******************************************************************************
13047 /* Function : PLIB_DMA_ExistsChannelXCellProgressPointer( DMA_MODULE_ID index )
13048  Summary:
13049  Identifies whether the ChannelXCellProgressPointer feature exists on the
13050  DMA module.
13051  Description:
13052  This function identifies whether the ChannelXCellProgressPointer feature is
13053  available on the DMA module.
13054  When this function returns true, this function is supported on the device:
13055  - PLIB_DMA_ChannelXCellProgressPointerGet
13056  Preconditions:
13057  None.
13058  Parameters:
13059  index - Identifier for the device instance
13060  Returns:
13061  - true - The ChannelXCellProgressPointer feature is supported on the device
13062  - false - The ChannelXCellProgressPointer feature is not supported on the device
13063  Remarks:
13064  None.
13065 */
13066 
13067 bool
13069  DMA_MODULE_ID index ) ;
13070 //******************************************************************************
13071 /* Function : PLIB_DMA_ExistsChannelXPatternData( DMA_MODULE_ID index )
13072  Summary:
13073  Identifies whether the ChannelXPatternData feature exists on the DMA module
13074  Description:
13075  This function identifies whether the ChannelXPatternData feature is available
13076  on the DMA module.
13077  When this function returns true, these functions are supported on the device:
13078  - PLIB_DMA_ChannelXPatternDataGet
13079  - PLIB_DMA_ChannelXPatternDataSet
13080  Preconditions:
13081  None.
13082  Parameters:
13083  index - Identifier for the device instance
13084  Returns:
13085  - true - The ChannelXPatternData feature is supported on the device
13086  - false - The ChannelXPatternData feature is not supported on the device
13087  Remarks:
13088  None.
13089 */
13090 
13091 bool
13093  DMA_MODULE_ID index ) ;
13094 //DOM-IGNORE-BEGIN
13095 //DOM-IGNORE-END
13096  // #ifndef _PLIB_DMA_H
13097 /*******************************************************************************
13098  End of File
13099 */
13100 
13101 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h*/
13102 /* CLOSE_FILE Include File */
13103 
13104 // *****************************************************************************
13105 // *****************************************************************************
13106 // Section: Data Types
13107 // *****************************************************************************
13108 // *****************************************************************************
13109 // *****************************************************************************
13110 /* DMA System Service Channel None
13111  Summary:
13112  DMA channel none
13113  Description:
13114  This constant identifies the specification of no choice from client
13115  for allocating a particular DMA channel.
13116  Remarks:
13117  This constant should be used in place of hard-coded numeric literals.
13118 */
13119 //DOM-IGNORE-BEGIN
13120 #define DMA_CHANNEL_NONE ( ( DMA_CHANNEL ) - 1 )
13121 //DOM-IGNORE-END
13122 // *****************************************************************************
13123 /* DMA System Service Channel Any
13124  Summary:
13125  Identifies the client specification to allocate any available DMA channel.
13126  Description:
13127  This constant identifies the specification by the client
13128  to allocate any available DMA channel.
13129  Remarks:
13130  This constant should be used in place of hard-coded numeric literals.
13131 */
13132 //DOM-IGNORE-BEGIN
13133 #define DMA_CHANNEL_ANY ( ( DMA_CHANNEL ) - 2 )
13134 //DOM-IGNORE-END
13135 // *****************************************************************************
13136 /* DMA System Service Channel Count
13137  Summary:
13138  Identifies the maximum number of DMA channel handles to be defined.
13139  Description:
13140  This constant identifies the maximum number of DMA channel handles
13141  that should be defined.
13142  Remarks:
13143  This value is derived from device-specific header files defined as
13144  part of the peripheral libraries.
13145 */
13146 #define SYS_DMA_CHANNEL_COUNT DMA_NUMBER_OF_CHANNELS
13147 // *****************************************************************************
13148 /* DMA System Service Channel Handle
13149  Summary:
13150  Assigns the handle for requested channel.
13151  Description:
13152  A channel handle value is returned by a call to the SYS_DMA_ChannelAllocate
13153  function. This handle is associated with the channel number that is used for
13154  data transfer and it allows the application to track the data transfer.
13155  The channel handle once assigned to a client expires when the
13156  client calls SYS_DMA_ChannelRelease.
13157  exits.
13158  Remarks:
13159  None.
13160 */
13161 
13162 typedef
13163 uintptr_t
13165 // *****************************************************************************
13166 /* DMA System Service Invalid Channel Handle
13167  Summary:
13168  Defines an invalid channel handle.
13169  Description:
13170  This is the definition of an invalid channel handle. An invalid buffer handle
13171  is returned by SYS_DMA_ChannelAllocate function if the channel number
13172  request was not successful.
13173  Remarks:
13174  None.
13175 */
13176 #define SYS_DMA_CHANNEL_HANDLE_INVALID ( ( SYS_DMA_CHANNEL_HANDLE ) ( - 1 ) )
13177 // *****************************************************************************
13178 /* DMA stop in idle mode
13179  Summary:
13180  Enable/Disable DMA operations in Idle mode.
13181  Description:
13182  This data type allows enabling/disabling of DMA operations in idle mode.
13183  Remarks:
13184  The field 'sidl' (in init data structure 'SYS_DMA_INIT') is enable/disable
13185  while initializing the DMA module by calling SYS_DMA_Initialize.
13186  This feature may not be available on all devices. Refer to the specific device
13187  data sheet to determine availability.
13188 */
13189 
13190 typedef
13191  enum
13192  {
13193  /* When the CPU enters idle mode, the DMA module continue operations */
13195  /* When the CPU enters idle mode, the DMA module will discontinue operations */
13197  } SYS_DMA_SIDL ;
13198 // *****************************************************************************
13199 /* DMA Channel chaining priority
13200  Summary:
13201  Identifies the priority of chaining channel.
13202  Description:
13203  This data type identifies the priority of chaining channel.
13204  Channel chaining priority identifies the channel that will be enabled
13205  on completion of block data transfer on the master channel.
13206  Remarks:
13207  None.
13208 */
13209 
13210 typedef
13211  enum
13212  {
13213  /* Chain to channel higher in natural priority */
13215  /* Chain to channel lower in natural priority */
13218 // *****************************************************************************
13219 /* DMA Channel ignore pattern match
13220  Summary:
13221  Enables/Disables the feature to ignore a byte between a 2-byte match abort
13222  pattern.
13223  Description:
13224  This data type allows enabling/disabling the feature to ignore a byte
13225  between a 2-byte match abort pattern.
13226  Remarks:
13227  This feature may not be available on all devices. Refer to the specific device
13228  data sheet to determine availability.
13229 */
13230 
13231 typedef
13232  enum
13233  {
13234  /* Disabling the feature to ignore a byte between a 2-byte match abort pattern. */
13236  /* Enable the feature to ignore a byte between a 2-byte match abort pattern. */
13239 // *****************************************************************************
13240 /* DMA channel CRC mode
13241  Summary:
13242  Identifies the operation mode of the CRC module.
13243  Description:
13244  This data type identifies CRC operating mode. The CRC computation can be
13245  in background mode or append mode.
13246  Remarks:
13247  None.
13248 */
13249 
13250 typedef
13251  enum
13252  {
13253  /* DMA reads the data from the source, passes it through the CRC module and
13254  writes it to the destination. the calculated CRC is left in the DCRCDATA
13255  register at the end of the block transfer. */
13257  /* DMA only feeds source data to the CRC module. it does not write source data
13258  to the destination address. When a block transfer complete or pattern abort
13259  event occur, The DMA writes the CRC value to the destination address */
13262 // *****************************************************************************
13263 /* DMA channel CRC write order
13264  Summary:
13265  Identifies altering/maintaining write order post CRC computation.
13266  Description:
13267  This data type identifies write byte order selection post CRC
13268  computation.
13269  Remarks:
13270  None.
13271 */
13272 
13273 typedef
13274  enum
13275  {
13276  /* Source data is written to the destination unchanged regardless
13277  of the selected pre-CRC byte order. */
13279  /* Source data is written to the destination reordered according
13280  to the selected pre-CRC byte order. */
13283 // *****************************************************************************
13284 /* DMA channel operation modes
13285  Summary:
13286  Identifies the available DMA operating modes.
13287  Description:
13288  This data type Identifies the available DMA operating modes.
13289  The supported DMA modes are not mutually exclusive, but can be simultaneously
13290  operational.
13291  Remarks:
13292  These supported DMA modes can be logically OR'd together. They are passed
13293  into the SYS_DMA_ChannelSetup function through the modeEnable parameter.
13294 */
13295 
13296 typedef
13297  enum
13298  {
13299  /* The normal DMA operation mode. The DMA channel will transfer data from
13300  a source to a destination without CPU intervention */
13301  SYS_DMA_CHANNEL_OP_MODE_BASIC /*DOM-IGNORE-BEGIN*/
13302  = ( 1 << 0 ) /*DOM-IGNORE-END*/
13303  ,
13304  /* Pattern Match abort mode allows the user to end a transfer if data
13305  written during a transaction matches a specific pattern, as defined by
13306  the DCHxDAT register */
13308  = ( 1 << 1 ) /*DOM-IGNORE-END*/
13309  ,
13310  /* Channel chaining operating mode enhances the normal DMA channel
13311  operations. A channel(slave) can be chained to an adjacent channel(master).
13312  The slave channel will be enabled when a block transfer of the master
13313  channel completes. */
13314  /* only one of the below two chaining priorities must be provided.
13315  Chaining priority High. */
13317  = ( 1 << 2 ) /*DOM-IGNORE-END*/
13318  ,
13319  /* Chaining priority Low */
13321  = ( 1 << 3 ) /*DOM-IGNORE-END*/
13322  ,
13323  /* Auto enable operating mode allows a channel to be kept active, even if a
13324  block transfer completes or pattern match occurs. This prevents the user
13325  from having to re-enable the channel each time a block transfer completes. */
13326  SYS_DMA_CHANNEL_OP_MODE_AUTO/*DOM-IGNORE-BEGIN*/
13327  = ( 1 << 4 ) /*DOM-IGNORE-END*/
13328  ,
13329  /* CRC operating mode allows computation of 16, 32-bit CRC. */
13330  SYS_DMA_CHANNEL_OP_MODE_CRC/*DOM-IGNORE-BEGIN*/
13331  = ( 1 << 5 ) /*DOM-IGNORE-END*/
13333 // *****************************************************************************
13334 /* DMA channel CRC mode
13335  Summary:
13336  Defines the attributes for CRC operation mode.
13337  Description:
13338  This data type defines the attributes for CRC operation mode.
13339  Remarks:
13340  This feature may not be available on all devices. Refer to the specific device
13341  data sheet to determine availability.
13342 */
13343 
13344 typedef
13345  struct
13346  {
13347  /* CRC type (PLIB-level).
13348  Type Selection identifies whether the CRC module will calculate an IP
13349  header checksum or an LFSR CRC */
13350  DMA_CRC_TYPE type ;
13351  /* CRC mode, Background or Append */
13353  /* Polynomial length, This value is redundant when the selected CRC type is
13354  IP header checksum. When the CRC type is LFSR, Identifies the length of
13355  the polynomial. */
13356  uint8_t polyLength ;
13357  /* Bit order (PLIB-level).
13358  Identifies whether the CRC is computed LSb or MSb first */
13359  DMA_CRC_BIT_ORDER bitOrder ;
13360  /* Byte order (PLIB-level).
13361  Identifies the byte selection order input pre-CRC Generator. */
13362  DMA_CRC_BYTE_ORDER byteOrder ;
13363  /* Post CRC Write order */
13364  SYS_DMA_CRC_WRITE_ORDER writeOrder ;
13365  /* CRC data feed: While enabling the CRC mode, this field gives
13366  the seed for the CRC computation. On block transfer complete or
13367  pattern match abort the field have the computed CRC. */
13368  uint32_t data ;
13369  /* XOR bit mask, This value is redundant when the selected CRC type is
13370  IP header checksum. When the CRC type is LFSR, Identifies the XOR
13371  bit mask input to the shift register during CRC computation. */
13372  uint32_t xorBitMask ;
13374 // *****************************************************************************
13375 /* DMA System service Events
13376  Summary:
13377  Enumeration of possible DMA System service events.
13378  Description:
13379  This data type provides an enumeration of all possible DMA System service events.
13380  Remarks:
13381  None.
13382 */
13383 
13384 typedef
13385  enum
13386  {
13387  /* Data was transferred successfully. */
13389  /* Error while processing the request */
13391  /* Data transfer was aborted. */
13393  /* No events yet. */
13396 // *****************************************************************************
13397 /* DMA System service Error
13398  Summary:
13399  Indicates the error information for the DMA System service.
13400  Description:
13401  This enumeration indicates the error information for the DMA System service.
13402  Remarks:
13403  None.
13404 */
13405 
13406 typedef
13407  enum
13408  {
13409  /* Data was transferred successfully. */
13410  SYS_DMA_ERROR_NONE /*DOM-IGNORE-BEGIN*/
13411  = 1 << 0 ,
13412  /* DOM-IGNORE-END*/
13413  /* DMA address error. */
13414  SYS_DMA_ERROR_ADDRESS_ERROR /*DOM-IGNORE-BEGIN*/
13415  = 1 << 1 /* DOM-IGNORE-END*/
13416  } SYS_DMA_ERROR ;
13417 // *****************************************************************************
13418 /* DMA Initialization data
13419  Summary:
13420  Defines the data required to initialize the DMA subsystem.
13421  Description:
13422  This data type defines the data required to initialize the DMA subsystem.
13423  Remarks:
13424  This feature may not be available on all devices. Refer to the specific device
13425  data sheet to determine availability.
13426 */
13427 
13428 typedef
13429  struct
13430  {
13431  /* Enable/Disable stop in idle mode feature */
13432  SYS_DMA_SIDL sidl ;
13433  } SYS_DMA_INIT ;
13434 // *****************************************************************************
13435 /* Data width options */
13436 
13437 typedef
13438  enum
13439  {
13440  /* Data width configuration feature is not available */
13442  } SYS_DMA_DATA_WIDTH ;
13443 // *****************************************************************************
13444 /* DMA descriptor control
13445  Summary:
13446  Defines the descriptor control for linked list operation.
13447  Description:
13448  This data type defines the descriptor control for linked list operation.
13449  Remarks:
13450  This feature may not be available on all devices. Refer to the specific device
13451  data sheet to determine availability.
13452 */
13453 
13454 typedef
13455  union
13456  {
13457  /* Feature is not supported */
13458  ;
13460 // *****************************************************************************
13461 // *****************************************************************************
13462 // Section: Initialization and Task Functions
13463 // *****************************************************************************
13464 // *****************************************************************************
13465 //******************************************************************************
13466 /* Function:
13467  void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
13468  Summary:
13469  Maintains the system service's state machine.
13470 
13471  Description:
13472  This function is used to maintain the DMA system service's internal state
13473  machine. This function services events on a specific DMA channel.
13474  Precondition:
13475  DMA should have been initialized by calling SYS_DMA_Initialize.
13476  Parameters:
13477  object - Object handle for the DMA module (returned from
13478  SYS_DMA_Initialize)
13479  activeChannel - DMA channel number to be serviced.
13480  Returns:
13481  None.
13482  Example:
13483  <code>
13484  // 'object' Returned from SYS_DMA_Initialize
13485  void __ISR(_DMA3_VECTOR,ipl5)_InterruptHandler_BT_USART_RX_DMA_CHANNEL(void)
13486  {
13487  SYS_DMA_Tasks(object, DMA_CHANNEL_3);
13488  }
13489  </code>
13490  Remarks:
13491  This function is normally not called directly by an application. It is
13492  called by the system's task/interrupt routines.
13493  */
13494 
13495 void
13496  SYS_DMA_Tasks (
13497  SYS_MODULE_OBJ object ,
13498  DMA_CHANNEL activeChannel ) ;
13499 //******************************************************************************
13500 /* For backward compatibility */
13501 #define SYS_DMA_TasksISR( object , activeChannel ) SYS_DMA_Tasks ( object , activeChannel )
13502  // #ifndef _SYS_DMA_DEFINITIONS_H
13503 /*******************************************************************************
13504  End of File
13505 */
13506 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h*/
13507 /* CLOSE_FILE Include File */
13508 
13509 // DOM-IGNORE-BEGIN
13510 // DOM-IGNORE-END
13511 // *****************************************************************************
13512 // *****************************************************************************
13513 // Section: DMA System Service Interface Routines
13514 // *****************************************************************************
13515 // *****************************************************************************
13516 // *****************************************************************************
13517 /* DMA System service Transfer Event Handler Function
13518  Summary:
13519  Pointer to a DMA System service Transfer Event handler function.
13520  Description:
13521  This data type defines a DMA System service Transfer Event Handler Function.
13522  A DMA system service client must register an transfer event handler function of
13523  this type to receive transfer related events from the system service.
13524  If the event is SYS_DMA_TRANSFER_EVENT_COMPLETE, this means that the data
13525  was transferred successfully. The channelHandle parameter contains the channel
13526  handle of the channel on which the transfer was processed.
13527  If the event is SYS_DMA_TRANSFER_EVENT_ERROR, this means that the data was
13528  not transferred successfully. TThe channelHandle parameter contains the channel
13529  handle of the channel on which the transfer had failed.
13530  The contextHandle parameter contains the context handle that was provided by
13531  the client at the time of registering the event handler. This context handle
13532  can be anything that the client consider helpful or necessary to identify
13533  the client context object associated with the channel of the system
13534  service that generated the event.
13535  The event handler function executes in an interrupt context when DMA is setup
13536  to start operation by an interrupt trigger source. It is recommended of the
13537  application to not perform process intensive operations with in this
13538  function.
13539  Remarks:
13540  None.
13541 */
13542 
13543 typedef
13545 SYS_DMA_CHANNEL_HANDLE handle ,
13546 uintptr_t contextHandle ) ;
13547 // *****************************************************************************
13548 // *****************************************************************************
13549 // Section: Initialization and Task Functions
13550 // *****************************************************************************
13551 // *****************************************************************************
13552 //******************************************************************************
13553 /* Function:
13554  SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT * const init)
13555  Summary:
13556  Initializes and Enables the DMA Controller.
13557  Description:
13558  This function Enables the DMA module. Enable/Disable stop in idle mode
13559  feature based on the passed parameter value.
13560  This function initializes the DMA module making it ready for clients to
13561  open and use it. The initialization data is specified by the init parameter.
13562  Precondition:
13563  None.
13564  Parameters:
13565  init - Pointer to the data structure containing any data
13566  necessary to initialize the hardware. This pointer may
13567  be null if no data is required and default
13568  initialization is to be used.
13569  Returns:
13570  If successful, returns a valid handle to the DMA module object.
13571  Otherwise, it returns SYS_MODULE_OBJ_INVALID.
13572  Example:
13573  <code>
13574  SYS_MODULE_OBJ objectHandle;
13575  SYS_DMA_INIT initParam;
13576  initParam.sidl = SYS_DMA_SIDL_ENABLE;
13577  objectHandle = SYS_DMA_Initialize(DRV_I2S_INDEX_1,
13578  (SYS_MODULE_INIT*)initParam);
13579  if (SYS_MODULE_OBJ_INVALID == objectHandle)
13580  {
13581  // Handle error
13582  }
13583  </code>
13584  Remarks:
13585  This function must be called before any other DMA systems service routines
13586  are called.
13587  Not all features are available on all micro-controllers.
13588 */
13589 
13590 SYS_MODULE_OBJ
13592  const SYS_MODULE_INIT * const init ) ;
13593 // *****************************************************************************
13594 // *****************************************************************************
13595 // Section: Channel Setup and management functions
13596 // *****************************************************************************
13597 // *****************************************************************************
13598 //******************************************************************************
13599 /* Function:
13600  SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate (DMA_CHANNEL channel)
13601  Summary:
13602  Allocates the specified DMA channel and returns a handle to it.
13603  Description:
13604  This function opens the specified DMA channel and provides a
13605  handle that must be provided to all other client-level operations to
13606  identify the caller and the DMA channel.
13607  Precondition:
13608  Function SYS_DMA_Initialize must have been called before calling this
13609  function.
13610  Parameters:
13611  channel - Channel number requested for allocation.
13612  When channel number specified is DMA_CHANNEL_ANY
13613  a random channel is allocated for DMA transfers.
13614  Returns:
13615  The channel handle for the requested channel number.
13616  If an error occurs, the return value is SYS_DMA_CHANNEL_HANDLE_INVALID.
13617  Error can occur.
13618  - if the requested channel number is invalid.
13619  - if the requested channel number is not free.
13620  Example:
13621  <code>
13622  DMA_CHANNEL channel;
13623  SYS_DMA_CHANNEL_HANDLE handle
13624  channel = DMA_CHANNEL_2;
13625  handle = SYS_DMA_ChannelAllocate(channel);
13626  if (SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
13627  {
13628  // Failed to allocate the channel
13629  }
13630  else
13631  {
13632  // Proceed with setting up the channel and adding the transfer
13633  }
13634  </code>
13635  Remarks:
13636  The handle returned is valid until the SYS_DMA_ChannelRelease routine is called.
13637  This function must be called before any other DMA channel Setup and management
13638  routines are called
13639 */
13640 
13643  DMA_CHANNEL channel ) ;
13644 //******************************************************************************
13645 /* Function:
13646  void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
13647  Summary:
13648  Deallocates and frees the channel specified by the handle.
13649  Description:
13650  This function deallocates an allocated-channel of the DMA module,
13651  invalidating the handle.
13652  Precondition:
13653  DMA should have been initialized by calling SYS_DMA_Initialize.
13654  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate
13655  Parameters:
13656  handle - A valid allocated-channel handle, returned from the service's
13657  Allocate routine
13658  Returns:
13659  None.
13660  Example:
13661  <code>
13662  DMA_CHANNEL channel;
13663  SYS_DMA_CHANNEL_HANDLE handle;
13664  channel = DMA_CHANNEL_2;
13665  handle = SYS_DMA_ChannelAllocate(channel);
13666  SYS_DMA_ChannelRelease(handle);
13667  </code>
13668  Remarks:
13669  After calling this routine, the handle passed in "handle" must not be used
13670  with any of the remaining service's routines. A new handle must be obtained by
13671  calling SYS_DMA_ChannelAllocate before the caller may use the service again
13672 */
13673 
13674 void
13676  SYS_DMA_CHANNEL_HANDLE handle ) ;
13677 //******************************************************************************
13678 /* Function:
13679  void SYS_DMA_ChannelSetup
13680  (
13681  SYS_DMA_CHANNEL_HANDLE handle,
13682  SYS_DMA_CHANNEL_OP_MODE modeEnable
13683  DMA_TRIGGER_SOURCE eventSrc
13684  )
13685  Summary:
13686  Setup the DMA channel parameters.
13687  Description:
13688  This function sets up the DMA channel parameters.
13689  It sets the channel priority and enables the mode of operations for the
13690  current system design.
13691  Precondition:
13692  DMA should have been initialized by calling SYS_DMA_Initialize.
13693  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13694  Parameters:
13695  handle - Handle of the DMA channel as returned by the
13696  SYS_DMA_ChannelAllocate function.
13697  priority - The priority to be associated to the channel.
13698  modeEnable - The supported operating modes to be enabled.
13699  This parameter can be logically ORed to specify
13700  multiple options.
13701  eventSrc - The event causing the cell transfer start.
13702  Returns:
13703  None.
13704  Example:
13705  <code>
13706  // 'handle' is a valid handle returned
13707  // by the SYS_DMA_ChannelAllocate function.
13708  SYS_DMA_CHANNEL_OP_MODE modeEnable;
13709  DMA_TRIGGER_SOURCE eventSrc;
13710  channel = DMA_CHANNEL_2;
13711  modeEnable = (SYS_DMA_CHANNEL_OP_MODE_BASIC | SYS_DMA_CHANNEL_OP_MODE_CRC);
13712  eventSrc = DMA_TRIGGER_USART_1_TRANSMIT;
13713  // Setup channel number, and enables basic and CRC mode
13714  SYS_DMA_ChannelSetup(handle, modeEnable,eventSrc);
13715  </code>
13716  Remarks:
13717  If SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT, SYS_DMA_CHANNEL_OP_MODE_CHAIN or
13718  SYS_DMA_CHANNEL_OP_MODE_CRC mode of operation is enabled, then corresponding
13719  mode setup API's needs to be called to set the related parameters.
13720  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE then
13721  SYS_DMA_ChannelForceStart must be called to start the DMA channel transfer.
13722  Not all features are available on all microcontrollers.
13723  */
13724 
13725 void
13727  SYS_DMA_CHANNEL_HANDLE handle ,
13728  SYS_DMA_CHANNEL_OP_MODE modeEnable ,
13729  DMA_TRIGGER_SOURCE eventSrc ) ;
13730 //******************************************************************************
13731 /* Function:
13732  void SYS_DMA_ChannelSetupMatchAbortMode
13733  (
13734  SYS_DMA_CHANNEL_HANDLE handle,
13735  uint16_t pattern,
13736  DMA_PATTERN_LENGTH length,
13737  SYS_DMA_CHANNEL_IGNORE_MATCH ignore,
13738  uint8_t ignorePattern
13739  )
13740  Summary:
13741  Setup the pattern match abort mode.
13742  Description:
13743  This function sets up the termination of DMA operation when the specified
13744  pattern is matched. Additionally on supported parts the function also
13745  sets up the ignoring of part of a pattern(8-bit) from match abort
13746  pattern(16-bit).
13747  Precondition:
13748  DMA should have been initialized by calling SYS_DMA_Initialize.
13749  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13750  The function SYS_DMA_ChannelSetup must be called to enable
13751  SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT before setting up pattern
13752  match mode features.
13753  Parameters:
13754  handle - Handle of the DMA channel as returned by the
13755  SYS_DMA_ChannelAllocate function.
13756  pattern - The pattern that needs to be matched to abort a DMA transfer.
13757  length - Match pattern length can be 1-byte or 2-byte.
13758  ignore - Enable/Disable a byte between a 2-byte pattern match.
13759  ignorePattern - The part of the pattern(8-bit) that needs to be ignored
13760  from the match abort pattern(16-bit)
13761  Returns:
13762  None.
13763  Example:
13764  <code>
13765  // Example 1
13766  // The following code is for a device with an 8-bit pattern value and no
13767  // support for pattern match ignore feature
13768  // 'handle' is a valid handle returned
13769  // by the SYS_DMA_ChannelAllocate function.
13770  uint16_t pattern;
13771  DMA_PATTERN_LENGTH length;
13772  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
13773  uint8_t ignorePattern;
13774  pattern = 0x00; //Stop transfer on detection of a NULL character
13775  length = DMA_PATTERN_LENGTH_NONE;
13776  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_DISABLE;
13777  ignorePattern = 0;
13778  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
13779  ignoreEnable, ignorePattern);
13780  // Example 2
13781  // The following code is for a device with a 16-bit pattern value and
13782  // support for pattern match ignore feature
13783  // 'handle' is a valid handle returned
13784  // by the SYS_DMA_ChannelAllocate function.
13785  uint16_t pattern;
13786  DMA_PATTERN_LENGTH length;
13787  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
13788  uint8_t ignorePattern;
13789  pattern = 0x0D0A; //Stop transfer on detection of '\r\n'
13790  length = DMA_PATTERN_MATCH_LENGTH_2BYTES;
13791  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_ENABLE;
13792  ignorePattern = 0x00; \\ Any null character between the termination pattern
13793  \\ '\r' and '\n' is ignored.
13794  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
13795  ignore, ignorePattern);
13796  </code>
13797  Remarks:
13798  The parameter 'pattern' (8-bit or 16-bit) is device-specific.
13799  Not all features are available on all devices.
13800  Refer to the specific device data sheet for details.
13801 */
13802 
13803 void
13805  SYS_DMA_CHANNEL_HANDLE handle ,
13806  uint16_t pattern ,
13807  DMA_PATTERN_LENGTH length ,
13809  uint8_t ignorePattern ) ;
13810 //******************************************************************************
13811 /* Function:
13812  void SYS_DMA_ChannelCRCSet
13813  (
13814  SYS_DMA_CHANNEL_HANDLE handle,
13815  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc
13816  )
13817  Summary:
13818  Sets up the CRC operation mode.
13819  Description:
13820  This function sets up the CRC computation features.
13821  Precondition:
13822  DMA should have been initialized by calling SYS_DMA_Initialize.
13823  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13824  The function SYS_DMA_ChannelSetup must be called to enable
13825  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
13826  Parameters:
13827  handle - Handle of the DMA channel as returned by the
13828  SYS_DMA_ChannelAllocate function.
13829  crc.type - CRC will calculate an IP header checksum or an LFSR CRC.
13830  crc.mode - Compute the CRC in Background/Append mode.
13831  crc.polyLength - Denotes the length of the polynomial.
13832  crc.bitOrder - CRC is calculated LSb/MSb first.
13833  crc.byteOrder - Byte selection order input pre-CRC Generator
13834  crc.writeOrder - Write byte order selection post-CRC computation
13835  crc.data - Computed/Seed CRC
13836  crc.xorBitMask - Enable/Disable XOR bit mask on the corresponding bits
13837  when mode is LFSR
13838  Returns:
13839  None.
13840  Example:
13841  <code>
13842  //Example 1
13843  // DMA calculation using the CRC background mode
13844  // 'handle' is a valid handle returned
13845  // by the SYS_DMA_ChannelAllocate function.
13846  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc;
13847  crc.type = DMA_CRC_LFSR;
13848  crc.mode = SYS_DMA_CHANNEL_CRC_MODE_BACKGROUND;
13849  crc.polyLength = 16;
13850  crc.bitOrder = DMA_CRC_BIT_ORDER_LSB;
13851  crc.byteOrder = DMA_CRC_BYTEORDER_NO_SWAPPING;
13852  crc.writeOrder = SYS_DMA_CRC_WRITE_ORDER_MAINTAIN;
13853  crc.data = 0xFFFF;
13854  crc.xorBitMask = 0x1021;
13855  SYS_DMA_ChannelCRCSet(handle, crc);
13856  </code>
13857  Remarks:
13858  This feature may not be available on all devices. Refer to the specific device
13859  data sheet to determine availability.
13860 */
13861 
13862 void
13864  SYS_DMA_CHANNEL_HANDLE handle ,
13866 //******************************************************************************
13867 /* Function:
13868  uint32_t SYS_DMA_ChannelCRCGet(void)
13869  Summary:
13870  Returns the computed CRC.
13871  Description:
13872  This function returns the computed CRC
13873  Precondition:
13874  DMA should have been initialized by calling SYS_DMA_Initialize.
13875  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13876  The function SYS_DMA_ChannelSetup must be called to enable
13877  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
13878  The CRC generator must have been previously setup using
13879  SYS_DMA_ChannelCRCSet.
13880  Parameters:
13881  None
13882  Returns:
13883  uint32_t - The Computed CRC.
13884  Example:
13885  <code>
13886  uint32_t computedCRC;
13887  computedCRC = SYS_DMA_ChannelCRCGet();
13888  </code>
13889  Remarks:
13890  To get the computed CRC value this function must be called after the block
13891  transfer completion event (i.e., after getting and processing the callback
13892  registered with SYS_DMA_ChannelTransferEventHandlerSet).
13893  This feature may not be available on all devices. Refer to the specific device
13894  data sheet to determine availability.
13895 */
13896 
13897 uint32_t
13898  SYS_DMA_ChannelCRCGet ( void ) ;
13899 //******************************************************************************
13900 /* Function:
13901  void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
13902  Summary:
13903  Enables a channel.
13904  Description:
13905  This function enables a channel.
13906  Precondition:
13907  DMA should have been initialized by calling SYS_DMA_Initialize.
13908  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13909  The function SYS_DMA_ChannelSetup must have been called to setup and
13910  enable the required features.
13911  Parameters:
13912  handle - Handle of the DMA channel as returned by the
13913  SYS_DMA_ChannelAllocate function.
13914  Returns:
13915  None.
13916  Example:
13917  <code>
13918  // 'handle' is a valid handle returned
13919  // by the SYS_DMA_ChannelAllocate function.
13920  SYS_DMA_ChannelEnable(handle);
13921  </code>
13922  Remarks:
13923  This function may not required to be called when starting DMA setup
13924  (by SYS_DMA_ChannelSetup) and transfer Add (by SYS_DMA_ChannelTransferAdd).
13925  But may be needed to be called in the registered callback to enable the
13926  channel and continue the data transfer with the existing transfer parameters
13927  previously set with 'SYS_DMA_ChannelTransferAdd'.
13928  The DMA channel is by default disabled on the completion of block
13929  transfer(callback generated)
13930 */
13931 
13932 void
13934  SYS_DMA_CHANNEL_HANDLE handle ) ;
13935 //******************************************************************************
13936 /* Function:
13937  void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
13938  Summary:
13939  Disables a channel.
13940  Description:
13941  This function disables a channel.
13942  Precondition:
13943  DMA should have been initialized by calling SYS_DMA_Initialize.
13944  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13945  The function SYS_DMA_ChannelSetup must have been called to setup and
13946  enable the required features.
13947  A DMA channel should have been enabled either by calling
13948  'SYS_DMA_ChannelTransferAdd' or 'SYS_DMA_ChannelEnable'
13949  Parameters:
13950  handle - Handle of the DMA channel as returned by the
13951  SYS_DMA_ChannelAllocate function.
13952  Returns:
13953  None.
13954  Example:
13955  <code>
13956  // 'handle' is a valid handle returned
13957  // by the SYS_DMA_ChannelAllocate function.
13958  SYS_DMA_ChannelDisable(handle);
13959  </code>
13960  Remarks:
13961  None.
13962 */
13963 
13964 void
13966  SYS_DMA_CHANNEL_HANDLE handle ) ;
13967 //******************************************************************************
13968 /* Function:
13969  void SYS_DMA_ChannelTransferAdd
13970  (
13971  SYS_DMA_CHANNEL_HANDLE handle,
13972  const void *srcAddr, size_t srcSize
13973  const void *destAddr, size_t destSize,
13974  size_t cellSize
13975  )
13976  Summary:
13977  Adds a data transfer to a DMA channel and Enables the channel to start
13978  data transfer.
13979  Description:
13980  This function adds a data transfer characteristics for a DMA channel. The
13981  The source and the destination addresses, source and destination lengths,
13982  The number of bytes transferred per cell event are set. It also enables
13983  the channel to start data transfer.
13984  If the requesting client registered an event callback with the service,
13985  the service will issue a SYS_DMA_TRANSFER_EVENT_COMPLETE or
13986  SYS_DMA_TRANSFER_EVENT_ABORT event if the transfered was processed
13987  successfully of SYS_DMA_TRANSFER_EVENT_ERROR event if the transfer was not
13988  processed successfully.
13989  Precondition:
13990  DMA should have been initialized by calling SYS_DMA_Initialize.
13991  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13992  The function SYS_DMA_ChannelSetup must have been called to setup and
13993  enable the required features.
13994  Parameters:
13995  handle - Handle of the DMA channel as returned by the
13996  SYS_DMA_ChannelAllocate function.
13997  srcAddr - Source of the DMA transfer
13998  srcSize - Size of the source
13999  destAddr - Destination of the DMA transfer
14000  destSize - Size of the destination
14001  cellSize - Size of the cell
14002  Returns:
14003  None.
14004  Example:
14005  <code>
14006  // Add 10 bytes of data transfer to UART TX
14007  // 'handle' is a valid handle returned
14008  // by the SYS_DMA_ChannelAllocate function.
14009  MY_APP_OBJ myAppObj;
14010  uint8_t buf[10];
14011  void *srcAddr;
14012  void *destAddr;
14013  size_t srcSize;
14014  size_t destSize;
14015  size_t cellSize;
14016  srcAddr = (uint8_t *) buf;
14017  srcSize = 10;
14018  destAddr = (uin8_t*) &U2TXREG;
14019  destSize = 1;
14020  cellSize = 1;
14021  // User registers an event handler with system service. This is done once
14022  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14023  (uintptr_t)&myAppObj);
14024  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14025  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14026  {
14027  // Error handling here
14028  }
14029  // Event Processing Technique. Event is received when
14030  // the transfer is processed.
14031  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14032  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14033  {
14034  switch(event)
14035  {
14036  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14037  // This means the data was transferred.
14038  break;
14039  case SYS_DMA_TRANSFER_EVENT_ERROR:
14040  // Error handling here.
14041  break;
14042  default:
14043  break;
14044  }
14045  }
14046  </code>
14047  Remarks:
14048  For PIC32MZ series of devices, if the source/destination addresses are
14049  RAM memory addresses, the the source/destination buffers
14050  should be made coherent to avoid the cache coherency issues.
14051  For example:
14052  <code>
14053  uint8_t buffer[1024];
14054  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14055  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14056  </code>
14057 */
14058 
14059 void
14061  SYS_DMA_CHANNEL_HANDLE handle ,
14062  const void * srcAddr ,
14063  size_t srcSize ,
14064  const void * destAddr ,
14065  size_t destSize ,
14066  size_t cellSize ) ;
14067 //******************************************************************************
14068 /* Function:
14069  void SYS_DMA_ChannelTransferSet
14070  (
14071  SYS_DMA_CHANNEL_HANDLE handle,
14072  const void *srcAddr, size_t srcSize
14073  const void *destAddr, size_t destSize,
14074  size_t cellSize
14075  )
14076  Summary:
14077  Sets up a data transfer to a DMA channel.
14078  Description:
14079  This function sets up data transfer characteristics for a DMA channel. The
14080  The source and the destination addresses, source and destination lengths,
14081  The number of bytes transferred per cell event are set.
14082  This function does not enables the DMA channel. The channel has to be explicitly
14083  enabled to start the data transfer.
14084  The above functions could be used in situations where in the user intends to
14085  setup transfer parameters but do not intend to enable the channel immediately.
14086  For example to chain to DMA channels in a cyclic order where the channels remains
14087  disabled. The channel is enabled automatically by the DMA when the transfer trigger
14088  condition occurs.
14089  Precondition:
14090  DMA should have been initialized by calling SYS_DMA_Initialize.
14091  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14092  The function SYS_DMA_ChannelSetup must have been called to setup and
14093  enable the required features.
14094  Parameters:
14095  handle - Handle of the DMA channel as returned by the
14096  SYS_DMA_ChannelAllocate function.
14097  srcAddr - Source of the DMA transfer
14098  srcSize - Size of the source
14099  destAddr - Destination of the DMA transfer
14100  destSize - Size of the destination
14101  cellSize - Size of the cell
14102  Returns:
14103  None.
14104  Example:
14105  <code>
14106  // Set up 10 bytes of data transfer to UART TX
14107  // 'handle' is a valid handle returned
14108  // by the SYS_DMA_ChannelAllocate function.
14109  MY_APP_OBJ myAppObj;
14110  uint8_t buf[10];
14111  void *srcAddr;
14112  void *destAddr;
14113  size_t srcSize;
14114  size_t destSize;
14115  size_t cellSize;
14116  srcAddr = (uint8_t *) buf;
14117  srcSize = 10;
14118  destAddr = (uin8_t*) &U2TXREG;
14119  destSize = 1;
14120  cellSize = 1;
14121  // User registers an event handler with system service. This is done once
14122  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14123  (uintptr_t)&myAppObj);
14124  SYS_DMA_ChannelTransferSet(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14125  SYS_DMA_ChannelEnable(handle);
14126  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14127  {
14128  // Error handling here
14129  }
14130  // Event Processing Technique. Event is received when
14131  // the transfer is processed.
14132  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14133  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14134  {
14135  switch(event)
14136  {
14137  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14138  // This means the data was transferred.
14139  break;
14140  case SYS_DMA_TRANSFER_EVENT_ERROR:
14141  // Error handling here.
14142  break;
14143  default:
14144  break;
14145  }
14146  }
14147  </code>
14148  Remarks:
14149  For PIC32MZ series of devices, if the source/destination addresses are
14150  RAM memory addresses, the the source/destination buffers
14151  should be made coherent to avoid the cache coherency issues.
14152  For example:
14153  <code>
14154  uint8_t buffer[1024];
14155  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14156  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14157  </code>
14158 */
14159 
14160 void
14162  SYS_DMA_CHANNEL_HANDLE handle ,
14163  const void * srcAddr ,
14164  size_t srcSize ,
14165  const void * destAddr ,
14166  size_t destSize ,
14167  size_t cellSize ) ;
14168 //******************************************************************************
14169 /* Function:
14170  size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14171  Summary:
14172  Returns the number of bytes transferred from source.
14173  Description:
14174  When a data transfer request is submitted. At any time while the transmission
14175  is in progress the size of the amount of data transferred from source
14176  can be known by calling this function.
14177  Precondition:
14178  DMA should have been initialized by calling SYS_DMA_Initialize.
14179  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14180  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14181  SYS_DMA_ChannelTransferSet.
14182  Parameters:
14183  handle - A valid channel handle, returned from the system service's
14184  Allocate routine
14185  Returns:
14186  size_t - Returns the number of bytes transferred from the submitted size.
14187  Example:
14188  <code>
14189  // 'handle' is a valid handle returned
14190  // by the SYS_DMA_ChannelAllocate function.
14191  MY_APP_OBJ myAppObj;
14192  uint8_t buf[10];
14193  void *srcAddr;
14194  void *destAddr;
14195  size_t srcSize;
14196  size_t destSize;
14197  size_t cellSize;
14198  size_t transferredSize;
14199  srcAddr = (uint8_t *) buf;
14200  srcSize = 10;
14201  destAddr = (uin8_t*) &U2TXREG;
14202  destSize = 1;
14203  cellSize = 1;
14204  channelHandle = SYS_DMA_ChannelAllocate(channel);
14205  // User registers an event handler with system service. This is done once
14206  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14207  (uintptr_t)&myAppObj);
14208  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14209  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14210  {
14211  // Error handling here
14212  }
14213  // The data is being transferred after adding the transfer to the DMA channel.
14214  // The user can get to know dynamically the amount of data
14215  // transmitted from source by calling SYS_DMA_ChannelSourceTransferredSizeGet
14216  transferredSize = SYS_DMA_ChannelSourceTransferredSizeGet(channelHandle);
14217  </code>
14218  Remarks:
14219  None.
14220 */
14221 
14222 size_t
14224  SYS_DMA_CHANNEL_HANDLE handle ) ;
14225 //******************************************************************************
14226 /* Function:
14227  size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14228  Summary:
14229  Returns the number of bytes transferred to destination.
14230  Description:
14231  When a data transfer request is submitted. At any time while the transmission
14232  is in progress the size of the amount of data transferred to destination
14233  can be known by calling this function.
14234  Precondition:
14235  DMA should have been initialized by calling SYS_DMA_Initialize.
14236  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14237  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14238  SYS_DMA_ChannelTransferSet.
14239  Parameters:
14240  handle - A valid channel handle, returned from the system service's
14241  Allocate routine
14242  Returns:
14243  size_t - Returns the number of bytes received from the submitted size.
14244  Example:
14245  <code>
14246  // 'handle' is a valid handle returned
14247  // by the SYS_DMA_ChannelAllocate function.
14248  MY_APP_OBJ myAppObj;
14249  uint8_t buf[10];
14250  void *srcAddr;
14251  void *destAddr;
14252  size_t srcSize;
14253  size_t destSize;
14254  size_t cellSize;
14255  size_t transferredSize;
14256  srcAddr = (uin8_t*) &U2RXREG;
14257  srcSize = 1;
14258  destAddr = (uint8_t *) buf ;
14259  destSize = 10;
14260  cellSize = 1;
14261  channelHandle = SYS_DMA_ChannelAllocate(channel);
14262  // User registers an event handler with system service. This is done once
14263  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14264  (uintptr_t)&myAppObj);
14265  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14266  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14267  {
14268  // Error handling here
14269  }
14270  // The data is being transferred after adding the transfer to the DMA channel.
14271  // The user can get to know dynamically the amount of data
14272  // transmitted to destination by calling SYS_DMA_ChannelDestinationTransferredSizeGet
14273  transferredSize = SYS_DMA_ChannelDestinationTransferredSizeGet(channelHandle);
14274  </code>
14275  Remarks:
14276  None.
14277 */
14278 
14279 size_t
14281  SYS_DMA_CHANNEL_HANDLE handle ) ;
14282 //******************************************************************************
14283 /*
14284  Function:
14285  void SYS_DMA_ChannelTransferEventHandlerSet
14286  (
14287  SYS_DMA_CHANNEL_HANDLE handle,
14288  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler,
14289  const uintptr_t contextHandle
14290  )
14291  Summary:
14292  This function allows a DMA system service client to set an event handler.
14293  Description:
14294  This function allows a client to set an event handler. The client may want
14295  to receive transfer related events in cases when it uses non-blocking read and
14296  write functions. The event handler should be set before the client
14297  intends to perform operations that could generate events.
14298  This function accepts a contextHandle parameter. This parameter could be
14299  set by the client to contain (or point to) any client specific data object
14300  that should be associated with this DMA channel.
14301  Precondition:
14302  DMA should have been initialized by calling SYS_DMA_Initialize.
14303  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14304  Parameters:
14305  handle - A valid channel handle, returned from the system service's
14306  Allocate routine
14307  eventHandler - Pointer to the event handler function.
14308  contextHandle - Value identifying the context of the application/driver/middleware
14309  that registered the event handling function.
14310  Returns:
14311  None.
14312  Example:
14313  <code>
14314  // 'handle' is a valid handle returned
14315  // by the SYS_DMA_ChannelAllocate function.
14316  MY_APP_OBJ myAppObj;
14317  uint8_t buf[10];
14318  void *srcAddr;
14319  void *destAddr;
14320  size_t srcSize;
14321  size_t destSize;
14322  size_t cellSize;
14323  srcAddr = (uint8_t *) buf;
14324  srcSize = 10;
14325  destAddr = (uin8_t*) &U2TXREG;
14326  destSize = 1;
14327  cellSize = 1;
14328  channelHandle = SYS_DMA_ChannelAllocate(channel);
14329  // User registers an event handler with system service. This is done once
14330  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14331  (uintptr_t)&myAppObj);
14332  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14333  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14334  {
14335  // Error handling here
14336  }
14337  // Event Processing Technique. Event is received when
14338  // the transfer is processed.
14339  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14340  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14341  {
14342  switch(event)
14343  {
14344  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14345  // This means the data was transferred.
14346  break;
14347  case SYS_DMA_TRANSFER_EVENT_ERROR:
14348  // Error handling here.
14349  break;
14350  default:
14351  break;
14352  }
14353  }
14354  </code>
14355  Remarks:
14356  None.
14357  */
14358 
14359 void
14361  SYS_DMA_CHANNEL_HANDLE handle ,
14362  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler ,
14363  const uintptr_t contextHandle ) ;
14364 // *****************************************************************************
14365 /* Function:
14366  SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
14367  Summary:
14368  This function returns the error(if any) associated with the last client
14369  request.
14370  Description:
14371  This function returns the error(if any) associated with the last client
14372  request. If the service send a SYS_DMA_TRANSFER_EVENT_ERROR to the client,
14373  the client can call this function to know the error cause.
14374  The error status will be updated on every operation and should be read
14375  frequently (ideally immediately after the service operation has completed)
14376  to know the relevant error status.
14377  Precondition:
14378  The SYS_DMA_Initialize routine must have been called for the DMA sub system.
14379  SYS_DMA_ChannelAllocate must have been called to obtain a valid opened channel
14380  handle.
14381  Parameters:
14382  handle - Handle of the DMA channel as returned by the
14383  SYS_DMA_ChannelAllocate function.
14384  Returns:
14385  A SYS_DMA_ERROR type indicating last known error status.
14386  Example:
14387  <code>
14388  // 'handle' is a valid handle returned
14389  // by the SYS_DMA_ChannelAllocate function.
14390  // pDmaSrc, pDmaDst is the source,destination address
14391  // txferSrcSize, txferDesSize is the source,destination transfer size
14392  // cellSize is the cell size
14393  MY_APP_OBJ myAppObj;
14394  // Client registers an event handler with service. This is done once
14395  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14396  (uintptr_t)&myAppObj );
14397  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14398  DMA_TRIGGER_SOURCE_NONE);
14399  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14400  pDmaDst,txferDesSize,cellSize);
14401  SYS_DMA_ChannelForceStart(handle);
14402  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14403  {
14404  // Error handling here
14405  }
14406  // Event Processing Technique. Event is received when
14407  // the transfer is processed.
14408  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14409  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14410  {
14411  switch(event)
14412  {
14413  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14414  // This means the data was transferred.
14415  break;
14416  case SYS_DMA_TRANSFER_EVENT_ERROR:
14417  // Error handling here.
14418  if(SYS_DMA_ERROR_ADDRESS_ERROR == SYS_DMA_ChannelErrorGet(handle))
14419  {
14420  // There was an address error.
14421  // Do error handling here.
14422  }
14423  break;
14424  default:
14425  break;
14426  }
14427  }
14428  </code>
14429  Remarks:
14430  It is the client's responsibility to make sure that the error status is
14431  obtained frequently. The service will update the error status
14432  regardless of whether this has been examined by the client.
14433 */
14434 
14437  SYS_DMA_CHANNEL_HANDLE handle ) ;
14438 //******************************************************************************
14439 /* Function:
14440  void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
14441  Summary:
14442  Force start of transfer on the selected channel.
14443  Description:
14444  The function force start a DMA transfer to occur for the selected channel.
14445  Precondition:
14446  DMA should have been initialized by calling SYS_DMA_Initialize.
14447  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14448  The function SYS_DMA_ChannelSetup must have been called to setup and
14449  enable the required features.
14450  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14451  Parameters:
14452  handle - Handle of the DMA channel as returned by the
14453  SYS_DMA_ChannelAllocate function.
14454  Returns:
14455  None.
14456  Example:
14457  <code>
14458  // 'handle' is a valid handle returned
14459  // by the SYS_DMA_ChannelAllocate function.
14460  // pDmaSrc, pDmaDst is the source,destination address
14461  // txferSrcSize, txferDesSize is the source,destination transfer size
14462  // cellSize is the cell size
14463  MY_APP_OBJ myAppObj;
14464  // Client registers an event handler with service. This is done once
14465  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14466  (uintptr_t)&myAppObj );
14467  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14468  DMA_TRIGGER_SOURCE_NONE);
14469  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14470  pDmaDst,txferDesSize,cellSize);
14471  SYS_DMA_ChannelForceStart(handle);
14472  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14473  {
14474  // Error handling here
14475  }
14476  // Event Processing Technique. Event is received when
14477  // the transfer is processed.
14478  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14479  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14480  {
14481  switch(event)
14482  {
14483  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14484  // This means the data was transferred.
14485  break;
14486  case SYS_DMA_TRANSFER_EVENT_ERROR:
14487  // Error handling here.
14488  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14489  {
14490  // There was an address error.
14491  // Do error handling here.
14492  }
14493  break;
14494  default:
14495  break;
14496  }
14497  }
14498  </code>
14499  Remarks:
14500  This function must be used to start the DMA transfer when the channel has been
14501  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14502 */
14503 
14504 void
14506  SYS_DMA_CHANNEL_HANDLE handle ) ;
14507 //******************************************************************************
14508 /* Function:
14509  void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
14510  Summary:
14511  Force abort of transfer on the selected channel.
14512  Description:
14513  The function aborts a DMA transfer to occur for the selected channel.
14514  Precondition:
14515  DMA should have been initialized by calling SYS_DMA_Initialize.
14516  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14517  The function SYS_DMA_ChannelSetup must have been called to setup and
14518  enable the required features.
14519  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14520  Parameters:
14521  handle - Handle of the DMA channel as returned by the
14522  SYS_DMA_ChannelAllocate function.
14523  Returns:
14524  None.
14525  Example:
14526  <code>
14527  // 'handle' is a valid handle returned
14528  // by the SYS_DMA_ChannelAllocate function.
14529  // pDmaSrc, pDmaDst is the source,destination address
14530  // txferSrcSize, txferDesSize is the source,destination transfer size
14531  // cellSize is the cell size
14532  MY_APP_OBJ myAppObj;
14533  // Client registers an event handler with service. This is done once
14534  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14535  (uintptr_t)&myAppObj );
14536  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14537  DMA_TRIGGER_SOURCE_NONE);
14538  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14539  pDmaDst,txferDesSize,cellSize);
14540  SYS_DMA_ChannelForceStart(handle);
14541  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14542  {
14543  // Error handling here
14544  }
14545  ....
14546  ....
14547  // Client may need to abort a transfer
14548  SYS_DMA_ChannelForceAbort(handle);
14549  // Event Processing Technique. Event is received when
14550  // the transfer is processed.
14551  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14552  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14553  {
14554  switch(event)
14555  {
14556  case SYS_DMA_TRANSFER_EVENT_ABORT:
14557  // This means the data was transferred.
14558  break;
14559  case SYS_DMA_TRANSFER_EVENT_ERROR:
14560  // Error handling here.
14561  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14562  {
14563  // There was an address error.
14564  // Do error handling here.
14565  }
14566  break;
14567  default:
14568  break;
14569  }
14570  }
14571  </code>
14572  Remarks:
14573  This function must be used to abort the DMA transfer when the channel has been
14574  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14575  and SYS_DMA_ChannelAbortEventSet has not been called.
14576 */
14577 
14578 void
14580  SYS_DMA_CHANNEL_HANDLE handle ) ;
14581 //******************************************************************************
14582 /* Function:
14583  void SYS_DMA_ChannelAbortEventSet
14584  (
14585  SYS_DMA_CHANNEL_HANDLE handle,
14586  DMA_TRIGGER_SOURCE eventSrc
14587  )
14588  Summary:
14589  Sets an event source and enables cell transfer abort event for the same
14590  for the selected channel.
14591  Description:
14592  This functions enables a cell transfer abort event for the selected source
14593  event.
14594  Precondition:
14595  DMA should have been initialized by calling SYS_DMA_Initialize.
14596  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14597  The function SYS_DMA_ChannelSetup must have been called to setup and
14598  enable the required features.
14599  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14600  Parameters:
14601  handle - Handle of the DMA channel as returned by the
14602  SYS_DMA_ChannelAllocate function.
14603  eventSrc - The event causing the cell transfer abort
14604  Returns:
14605  None.
14606  Example:
14607  <code>
14608  // 'handle' is a valid handle returned
14609  // by the SYS_DMA_ChannelAllocate function.
14610  // pDmaSrc, pDmaDst is the source,destination address
14611  // txferSrcSize, txferDesSize is the source,destination transfer size
14612  // cellSize is the cell size
14613  MY_APP_OBJ myAppObj;
14614  // Client registers an event handler with service. This is done once
14615  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14616  (uintptr_t)&myAppObj );
14617  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14618  DMA_TRIGGER_SOURCE_NONE);
14619  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14620  pDmaDst,txferDesSize,cellSize);
14621  SYS_DMA_ChannelAbortEventSet(handle, DMA_TRIGGER_CTMU);
14622  SYS_DMA_ChannelForceStart(handle);
14623  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14624  {
14625  // Error handling here
14626  }
14627  // Event Processing Technique. Event is received when
14628  // the transfer is processed.
14629  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14630  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14631  {
14632  switch(event)
14633  {
14634  case SYS_DMA_TRANSFER_EVENT_ABORT:
14635  // This means the data was transferred.
14636  break;
14637  case SYS_DMA_TRANSFER_EVENT_ERROR:
14638  // Error handling here.
14639  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14640  {
14641  // There was an address error.
14642  // Do error handling here.
14643  }
14644  break;
14645  default:
14646  break;
14647  }
14648  }
14649  </code>
14650  Remarks:
14651  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE the
14652  current DMA transfer will be aborted. The behavior is a same as calling
14653  SYS_DMA_ChannelForceAbort.
14654 */
14655 
14656 void
14658  SYS_DMA_CHANNEL_HANDLE handle ,
14659  DMA_TRIGGER_SOURCE eventSrc ) ;
14660 //******************************************************************************
14661 /* Function:
14662  bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
14663  Summary:
14664  Returns the busy status of the specified DMA channel.
14665  Description:
14666  This function returns the busy status of the selected DMA channel
14667  Precondition:
14668  DMA should have been initialized by calling SYS_DMA_Initialize.
14669  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14670  Parameters:
14671  handle - Handle of the DMA channel as returned by the
14672  SYS_DMA_ChannelAllocate function.
14673  Returns:
14674  bool - true, if the selected DMA channel is active or enabled
14675  - false, if the selected DMA channel is inactive or disabled
14676  Example:
14677  <code>
14678  bool busyStat;
14679  busyStat = SYS_DMA_ChannelGetBusy(handle);
14680  </code>
14681  Remarks:
14682  This feature may not be available on all devices. Refer to the specific device
14683  data sheet to determine availability.
14684 */
14685 
14686 bool
14688  SYS_DMA_CHANNEL_HANDLE handle ) ;
14689 //******************************************************************************
14690 /* Function:
14691  void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
14692  Summary:
14693  Suspend DMA operation on the specified DMA channel.
14694  Description:
14695  This function suspends the DMA operation on the DMA channel
14696  specified by the channel handle.
14697  Precondition:
14698  DMA should have been initialized by calling SYS_DMA_Initialize.
14699  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14700  Parameters:
14701  handle - Handle of the DMA channel as returned by the
14702  SYS_DMA_ChannelAllocate function.
14703  Returns:
14704  None.
14705  Example:
14706  <code>
14707  SYS_DMA_ChannelSuspend(handle);
14708  </code>
14709  Remarks:
14710  This feature may not be available on all devices. Refer to the specific device
14711  data sheet to determine availability.
14712 */
14713 
14714 void
14716  SYS_DMA_CHANNEL_HANDLE handle ) ;
14717 //******************************************************************************
14718 /* Function:
14719  void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
14720  Summary:
14721  Resume DMA operation on the specified DMA channel.
14722  Description:
14723  This function resumes the DMA operation on the DMA channel
14724  specified by the channel handle.
14725  Precondition:
14726  DMA should have been initialized by calling SYS_DMA_Initialize.
14727  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14728  Parameters:
14729  handle - Handle of the DMA channel as returned by the
14730  SYS_DMA_ChannelAllocate function.
14731  Returns:
14732  None.
14733  Example:
14734  <code>
14735  SYS_DMA_ChannelResume(handle);
14736  </code>
14737  Remarks:
14738  This feature may not be available on all devices. Refer to the specific device
14739  data sheet to determine availability.
14740 */
14741 
14742 void
14744  SYS_DMA_CHANNEL_HANDLE handle ) ;
14745 // *****************************************************************************
14746 // *****************************************************************************
14747 // Section: Global DMA Management Functions
14748 // *****************************************************************************
14749 // *****************************************************************************
14750 //******************************************************************************
14751 /* Function:
14752  void SYS_DMA_Suspend(void)
14753  Summary:
14754  Suspend DMA transfers.
14755  Description:
14756  This function suspends DMA transfers to allow CPU uninterrupted access
14757  to data bus
14758  Precondition:
14759  DMA should have been initialized by calling SYS_DMA_Initialize.
14760  Parameters:
14761  None.
14762  Returns:
14763  None.
14764  Example:
14765  <code>
14766  SYS_DMA_Suspend();
14767  </code>
14768  Remarks:
14769  None
14770 */
14771 
14772 void
14773  SYS_DMA_Suspend ( void ) ;
14774 //******************************************************************************
14775 /* Function:
14776  void SYS_DMA_Resume(void)
14777  Summary:
14778  Resume DMA operations.
14779  Description:
14780  This function disables DMA suspend. It resumes the DMA operation suspended
14781  by calling SYS_DMA_Suspend. The DMA operates normally.
14782  Precondition:
14783  DMA should have been initialized by calling SYS_DMA_Initialize.
14784  Parameters:
14785  None.
14786  Returns:
14787  None.
14788  Example:
14789  <code>
14790  SYS_DMA_Resume();
14791  </code>
14792  Remarks:
14793  None
14794 */
14795 
14796 void
14797  SYS_DMA_Resume ( void ) ;
14798 //******************************************************************************
14799 /* Function:
14800  bool SYS_DMA_IsBusy(void)
14801  Summary:
14802  Returns the busy status of the DMA module.
14803  Description:
14804  This function returns the busy status of the DMA module
14805  Precondition:
14806  DMA should have been initialized by calling SYS_DMA_Initialize.
14807  Parameters:
14808  None.
14809  Returns:
14810  Boolean
14811  - true - The DMA module is active
14812  - false - The DMA module is inactive and disabled
14813  <code>
14814  bool busyStat;
14815  busyStat = SYS_DMA_IsBusy();
14816  </code>
14817  Remarks:
14818  This feature may not be available on all devices. Refer to the specific device
14819  data sheet to determine availability.
14820 */
14821 
14822 bool
14823  SYS_DMA_IsBusy ( void ) ;
14824 // *****************************************************************************
14825 // *****************************************************************************
14826 // Section: Deprecated functions
14827 // *****************************************************************************
14828 // *****************************************************************************
14829 //*******************************************************************************
14830 /* Function:
14831  void SYS_DMA_TasksISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
14832  Summary:
14833  This function is deprecated. Use SYS_DMA_Tasks function.
14834  */
14835 
14836 void
14837  SYS_DMA_Tasks (
14838  SYS_MODULE_OBJ object ,
14839  DMA_CHANNEL activeChannel ) ;
14840 //*****************************************************************************
14841 /* Function:
14842  void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
14843  Summary:
14844  This function is deprecated. Use SYS_DMA_Tasks function.
14845  */
14846 
14847 void
14849  SYS_MODULE_OBJ object ) ;
14850 //*******************************************************************************
14851 /* Function:
14852  void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
14853  Summary:
14854  This function is deprecated. Use SYS_DMA_Tasks function.
14855  */
14856 
14857 void
14859  SYS_MODULE_OBJ object ,
14860  DMA_CHANNEL activeChannel ) ;
14861  // #ifndef _SYS_DMA_H
14862 /*******************************************************************************
14863  End of File
14864 */
14865 
14866 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h*/
14867 /* CLOSE_FILE Include File */
14868 
14869 // DOM-IGNORE-BEGIN
14870 // DOM-IGNORE-END
14871 // *****************************************************************************
14872 // *****************************************************************************
14873 // Section: Data Types
14874 // *****************************************************************************
14875 // *****************************************************************************
14876 // *****************************************************************************
14877 /* Driver USART Module Index
14878  Summary:
14879  USART driver index definitions
14880  Description:
14881  These constants provide USART driver index definitions.
14882  Remarks:
14883  These constants should be used in place of hard-coded numeric literals.
14884  These values should be passed into the DRV_USART_Initialize and
14885  DRV_USART_Open routines to identify the driver instance in use.
14886 */
14887 #define DRV_USART_INDEX_0 0
14888 #define DRV_USART_INDEX_1 1
14889 #define DRV_USART_INDEX_2 2
14890 #define DRV_USART_INDEX_3 3
14891 #define DRV_USART_INDEX_4 4
14892 #define DRV_USART_INDEX_5 5
14893 // *****************************************************************************
14894 /* USART Driver Module Count
14895  Summary:
14896  Number of valid USART drivers
14897  Description:
14898  This constant identifies the maximum number of USART Driver instances that
14899  should be defined in the system. Defining more instances than this
14900  constant will waste RAM memory space.
14901  This constant can also be used by the system and application to identify the
14902  number of USART instances on this microcontroller.
14903  Remarks:
14904  This value is part-specific.
14905 */
14906 #define DRV_USART_COUNT USART_NUMBER_OF_MODULES
14907 // *****************************************************************************
14908 /* USART Driver Write Error
14909  Summary:
14910  USART Driver Write Error.
14911  Description:
14912  This constant is returned by DRV_USART_Write() function when an error
14913  occurs.
14914  Remarks:
14915  None.
14916 */
14917 #define DRV_USART_WRITE_ERROR ( ( uint32_t ) ( - 1 ) )
14918 // *****************************************************************************
14919 /* USART Driver Read Error
14920  Summary:
14921  USART Driver Read Error.
14922  Description:
14923  This constant is returned by DRV_USART_Read() function when an error
14924  occurs.
14925  Remarks:
14926  None.
14927 */
14928 #define DRV_USART_READ_ERROR ( ( uint32_t ) ( - 1 ) )
14929 // *****************************************************************************
14930 /* USART Driver Buffer Handle
14931  Summary:
14932  Handle identifying a read or write buffer passed to the driver.
14933  Description:
14934  A buffer handle value is returned by a call to the DRV_USART_BufferAddRead
14935  or DRV_USART_BufferAddWrite functions. This handle is associated with the
14936  buffer passed into the function and it allows the application to track the
14937  completion of the data from (or into) that buffer. The buffer handle value
14938  returned from the "buffer add" function is returned back to the client
14939  by the "event handler callback" function registered with the driver.
14940  The buffer handle assigned to a client request expires when the client has
14941  been notified of the completion of the buffer transfer (after event handler
14942  function that notifies the client returns) or after the buffer has been
14943  retired by the driver if no event handler callback was set.
14944  Remarks:
14945  None
14946 */
14947 
14948 typedef
14949 uintptr_t
14951 // *****************************************************************************
14952 /* USART Driver Invalid Buffer Handle
14953  Summary:
14954  Definition of an invalid buffer handle.
14955  Description:
14956  This is the definition of an invalid buffer handle. An invalid buffer handle
14957  is returned by DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite
14958  functions if the buffer add request was not successful.
14959  Remarks:
14960  None
14961 */
14962 #define DRV_USART_BUFFER_HANDLE_INVALID ( ( DRV_USART_BUFFER_HANDLE ) ( - 1 ) )
14963 // *****************************************************************************
14964 /* USART Modes of Operation
14965  Summary:
14966  Identifies the modes of the operation of the USART module
14967  Description:
14968  This data type identifies the modes of the operation of the USART module.
14969  Remarks:
14970  Not all modes are available on all devices. Refer to the specific device data
14971  sheet to determine availability.
14972 */
14973 
14974 typedef
14975  enum
14976  {
14977  /* USART works in IRDA mode */
14979  /* This is the normal point to point communication mode where the USART
14980  communicates directly with another USART by connecting it's Transmit signal
14981  to the external USART's Receiver signal and vice versa. An external
14982  transceiver may be connected to obtain RS-232 signal levels. This type of
14983  connection is typically full duplex. */
14985  /* This is a multi-point bus mode where the USART can communicate with
14986  many other USARTS on a bus using an address-based protocol such as RS-485.
14987  This mode is typically half duplex and the physical layer may require a
14988  transceiver. In this mode every USART on the bus is assigned an address and
14989  the number of data bits is 9 bits */
14991  /* Loopback mode internally connects the Transmit signal to the Receiver
14992  signal, looping data transmission back into this USART's own input. It is
14993  useful primarily as a test mode. */
14996 // *****************************************************************************
14997 /* USART Driver Buffer Events
14998  Summary
14999  Identifies the possible events that can result from a buffer add request.
15000  Description
15001  This enumeration identifies the possible events that can result from a
15002  buffer add request caused by the client calling either the
15003  DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite functions.
15004  Remarks:
15005  One of these values is passed in the "event" parameter of the event
15006  handling callback function that the client registered with the driver by
15007  calling the DRV_USART_BufferEventHandlerSet function when a buffer
15008  transfer request is completed.
15009 */
15010 
15011 typedef
15012  enum
15013  {
15014  /* All data from or to the buffer was transferred successfully. */
15016  /* There was an error while processing the buffer transfer request. */
15018  /* Data transfer aborted (Applicable in DMA mode) */
15021 // *****************************************************************************
15022 /* USART Driver Buffer Result
15023  Summary
15024  Identifies the possible result of the buffer processing.
15025  Description
15026  This enumeration identifies the possible result of the buffer processing.
15027 
15028  Remarks:
15029  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED is the state of the buffer which
15030  is in the free buffer pool.
15031 */
15032 
15033 typedef
15034  enum
15035  {
15036  /* Buffer handle is not valid*/
15038  /* Buffer handle has expired. */
15040  /* Buffer is removed from the queue succesfully*/
15042  /* Buffer removal failed because of unable to acquire the mutex
15043  * This is applicable in RTOS mode only */
15046 // *****************************************************************************
15047 /* USART Driver Buffer Event Handler Function Pointer
15048  Summary
15049  Pointer to a USART Driver Buffer Event handler function
15050  Description
15051  This data type defines the required function signature for the USART driver
15052  buffer event handling callback function. A client must register a pointer
15053  to a buffer event handling function whose function signature (parameter
15054  and return value types) match the types specified by this function pointer
15055  in order to receive buffer related event calls back from the driver.
15056  The parameters and return values and are described here and
15057  a partial example implementation is provided.
15058  Parameters:
15059  event - Identifies the type of event
15060  bufferHandle - Handle identifying the buffer to which the vent relates
15061  context - Value identifying the context of the application that registered
15062  the event handling function.
15063  Returns:
15064  None.
15065  Example:
15066  <code>
15067  void APP_MyBufferEventHandler( DRV_USART_BUFFER_EVENT event,
15068  DRV_USART_BUFFER_HANDLE bufferHandle,
15069  uintptr_t context )
15070  {
15071  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
15072  switch(event)
15073  {
15074  case DRV_USART_BUFFER_EVENT_COMPLETE:
15075  // Handle the completed buffer.
15076  break;
15077  case DRV_USART_BUFFER_EVENT_ERROR:
15078  default:
15079  // Handle error.
15080  break;
15081  }
15082  }
15083  </code>
15084  Remarks:
15085  If the event is DRV_USART_BUFFER_EVENT_COMPLETE, it means that the data was
15086  transferred successfully.
15087  If the event is DRV_USART_BUFFER_EVENT_ERROR, it means that the data was not
15088  transferred successfully. The DRV_USART_ErrorGet function can be called to
15089  know the error. The DRV_USART_BufferCompletedBytesGet function can be
15090  called to find out how many bytes were processed.
15091  The bufferHandle parameter contains the buffer handle of the buffer that
15092  associated with the event.
15093  The context parameter contains the a handle to the client context,
15094  provided at the time the event handling function was registered using the
15095  DRV_USART_BufferEventHandlerSet function. This context handle value is
15096  passed back to the client as the "context" parameter. It can be any value
15097  necessary to identify the client context or instance (such as a pointer to
15098  the client's data) instance of the client that made the buffer add request.
15099  The event handler function executes in the driver peripheral's interrupt
15100  context when the driver is configured for interrupt mode operation. It is
15101  recommended of the application to not perform process intensive or blocking
15102  operations with in this function.
15103  The DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite functions can
15104  be called in the event handler to add a buffer to the driver queue. These
15105  functions can only be called to add buffers to the driver whose event
15106  handler is running. For example, buffers cannot be added USART2 driver in
15107  USART1 driver event handler.
15108 */
15109 
15110 typedef
15112 DRV_USART_BUFFER_HANDLE bufferHandle ,
15113 uintptr_t context ) ;
15114 // *****************************************************************************
15115 /* USART Driver Byte Event Handler Function Pointer
15116  Summary
15117  Pointer to a USART Driver Byte Event handler function
15118  Description
15119  This data type defines the required function signature for the USART driver
15120  byte event handling callback function. A client must register a pointer to a
15121  byte event handling function whose function signature (parameter and return
15122  value types) match the types specified by this function pointer in order to
15123  receive byte related event calls back from the driver.
15124  Parameters:
15125  index - Identifier for the instance
15126  Returns:
15127  None.
15128  Example:
15129  <code>
15130  void APP_MyUsartTxEventHandler(void)
15131  {
15132  // Handle the transmit byte event
15133  }
15134  </code>
15135  Remarks:
15136  The event handler function executes in the driver peripheral's interrupt
15137  context when the driver is configured for interrupt mode operation. It is
15138  recommended that the application not perform process intensive or blocking
15139  operations with in this function.
15140 */
15141 
15142 typedef
15143 void ( * DRV_USART_BYTE_EVENT_HANDLER ) ( const SYS_MODULE_INDEX index ) ;
15144 // *****************************************************************************
15145 /* USART Handshake Modes
15146  Summary:
15147  Identifies the handshaking modes supported by the USART driver.
15148  Description:
15149  This data type identifies the handshaking modes supported by the USART
15150  driver.
15151  Remarks:
15152  Not all modes are available on all devices. Refer to the specific device data
15153  sheet to determine availability.
15154 */
15155 
15156 typedef
15157  enum
15158  {
15159  /* Handshaking occurs in Flow Control Mode */
15160  DRV_USART_HANDSHAKE_FLOWCONTROL = /*DOM-IGNORE-BEGIN*/
15161  USART_HANDSHAKE_MODE_FLOW_CONTROL /*DOM-IGNORE-END*/
15162  ,
15163  /* Handshaking occurs in Simplex Mode */
15164  DRV_USART_HANDSHAKE_SIMPLEX = /*DOM-IGNORE-BEGIN*/
15165  USART_HANDSHAKE_MODE_SIMPLEX /*DOM-IGNORE-END*/
15166  ,
15167  /* No Handshaking */
15168  DRV_USART_HANDSHAKE_NONE = /*DOM-IGNORE-BEGIN*/
15169  2 /*DOM-IGNORE-END*/
15171 // *****************************************************************************
15172 /* USART Baud Set Result
15173  Summary:
15174  Identifies the results of the baud set function.
15175  Description:
15176  This data type identifies the results of the DRV_USART_BaudSet function.
15177  Remarks:
15178  None.
15179 */
15180 
15181 typedef
15182  enum
15183  {
15184  /* The driver was not able to change the baud */
15185  DRV_USART_BAUD_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15186  - 1 /*DOM-IGNORE-END*/
15187  ,
15188  /* The driver was able to change the baud successfully */
15191 // *****************************************************************************
15192 /* USART Line Control Set Result
15193  Summary:
15194  Identifies the results of the baud set function.
15195  Description:
15196  This data type identifies the results of the DRV_USART_LineControlSet
15197  function.
15198  Remarks:
15199  None.
15200 */
15201 
15202 typedef
15203  enum
15204  {
15205  /* The driver was not able to change the Line Control */
15206  DRV_USART_LINE_CONTROL_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15207  - 1 /*DOM-IGNORE-END*/
15208  ,
15209  /* The driver was able to change the Line Control successfully */
15212 // *****************************************************************************
15213 /* USART Line Control Modes
15214  Summary:
15215  Identifies the line control modes supported by the USART driver.
15216  Description:
15217  This data type identifies the line control modes supported by the USART
15218  driver. Line control modes define the number of data bits, parity mode, and
15219  the number of stop bits in a USART transmit and receive frames.
15220  Remarks:
15221  The abbreviations used in the labels for the values of this enumeration
15222  follow the format <data><parity><stop>, where:
15223  <data> is the number of data bits
15224  <parity> is either "NONE" (for no parity), "EVEN" for 1 parity bit
15225  added to obtain an even number of bits, or "ODD" for one bit
15226  added to obtain an odd number of bits.
15227  <stop> is the number of Stop bits
15228 */
15229 
15230 typedef
15231  enum
15232  {
15233  /* 8 data bits, no parity bit, 1 stop bit */
15234  DRV_USART_LINE_CONTROL_8NONE1 = /*DOM-IGNORE-BEGIN*/
15235  USART_8N1 /* DOM-IGNORE-END*/
15236  ,
15237  /* 9 data bits, no parity bit, 1 stop bit */
15238  DRV_USART_LINE_CONTROL_9NONE1 = /*DOM-IGNORE-BEGIN*/
15239  USART_9N1 /* DOM-IGNORE-END*/
15240  ,
15241  /* 8 data bits, 1 bit for even parity, 1 stop bit */
15242  DRV_USART_LINE_CONTROL_8EVEN1 = /*DOM-IGNORE-BEGIN*/
15243  USART_8E1 /* DOM-IGNORE-END*/
15244  ,
15245  /* 8 data bits, 1 bit for even parity, 2 stop bits */
15246  DRV_USART_LINE_CONTROL_8EVEN2 = /*DOM-IGNORE-BEGIN*/
15247  USART_8E2 /* DOM-IGNORE-END*/
15248  ,
15249  /* 8 data bits, 1 bit for odd parity, 1 stop bit */
15250  DRV_USART_LINE_CONTROL_8ODD1 = /*DOM-IGNORE-BEGIN*/
15251  USART_8O1 /* DOM-IGNORE-END*/
15252  ,
15253  /* 8 data bits, 1 bit for odd parity, 2 stop bits */
15254  DRV_USART_LINE_CONTROL_8ODD2 = /*DOM-IGNORE-BEGIN*/
15255  USART_8O2 /* DOM-IGNORE-END*/
15256  ,
15257  /* 8 data bits, no parity bit, 2 stop bit */
15258  DRV_USART_LINE_CONTROL_8NONE2 = /*DOM-IGNORE-BEGIN*/
15259  USART_8N2 /* DOM-IGNORE-END*/
15260  ,
15261  /* 9 data bits, no parity bit, 2 stop bit */
15262  DRV_USART_LINE_CONTROL_9NONE2 = /*DOM-IGNORE-BEGIN*/
15263  USART_9N2 /* DOM-IGNORE-END*/
15265 // *****************************************************************************
15266 /* USART Initialization flags
15267  Summary:
15268  Flags identifying features that can be enabled when the driver is
15269  initialized.
15270  Description:
15271  This enumeration defines flags identifying features that can be enabled
15272  when the driver is initialized.
15273  Remarks:
15274  These flags can be logically ORed together. They are passed into the
15275  DRV_USART_Initialize function through the "flags" member of the
15276  DRV_USART_INIT structure.
15277 */
15278 
15279 typedef
15280  enum
15281  {
15282  /* Use this if no flags need to be set */
15283  DRV_USART_INIT_FLAG_NONE = /* DOM-IGNORE-BEGIN */
15284  0 /*DOM-IGNORE-END*/
15285  ,
15286  /* Flag to enable "wake on start" operation. If supported and enabled,
15287  this feature will allow the USART to wake-up the device when a
15288  Start bit is received. This option should be selected only when the
15289  device is to placed in Sleep mode. Note that enabling this bit will
15290  also cause the first received character to be lost. Refer to the specific
15291  device data sheet for more information. */
15293  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15294  ,
15295  /* Flag to enable auto baud detection. If supported and enabled, this
15296  feature will allow the USART to automatically detect the baud rate in
15297  use. */
15298  DRV_USART_INIT_FLAG_AUTO_BAUD/*DOM-IGNORE-BEGIN*/
15299  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15300  ,
15301  /* Flag to enable stop in idle. If supported and enabled , this
15302  feature will allow the USART to stop when the CPU enters Idle
15303  mode */
15305  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15307 // *****************************************************************************
15308 /* Operation Mode Initialization Data
15309  Summary:
15310  Defines the initialization data required for different operation modes of
15311  USART.
15312  Description:
15313  This data type defines the initialization data required for different
15314  operation modes of the USART.
15315  Remarks:
15316  None
15317 */
15318 
15319 typedef
15320  union
15321  {
15322  /* Initialization for Addressed mode */
15323  struct
15324  {
15325  /* Address of the device. */
15326  uint8_t address ;
15327  } AddressedModeInit ;
15329 // *****************************************************************************
15330 /* USART Driver Errors.
15331  Summary:
15332  Defines the possible errors that can occur during driver operation.
15333  Description:
15334  This data type defines the possible errors that can occur when occur during
15335  USART driver operation. These values are returned by DRV_USART_ErrorGet
15336  function.
15337  Remarks:
15338  None
15339 */
15340 
15341 typedef
15342  enum
15343  {
15344  /* There was no error */
15346  /*DOM-IGNORE-BEGIN*/
15347  = USART_ERROR_NONE /*DOM-IGNORE-END*/
15348  ,
15349  /* This indicates that a parity error has occurred */
15351  /*DOM-IGNORE-BEGIN*/
15352  = USART_ERROR_PARITY /*DOM-IGNORE-END*/
15353  ,
15354  /* This indicates that a framing error has occurred */
15356  /*DOM-IGNORE-BEGIN*/
15357  = USART_ERROR_FRAMING /*DOM-IGNORE-END*/
15358  ,
15359  /* This indicates a receiver overflow has occurred */
15361  /*DOM-IGNORE-BEGIN*/
15362  = USART_ERROR_RECEIVER_OVERRUN /*DOM-IGNORE-END*/
15363  ,
15364  /* Channel address error (Applicable in DMA mode) */
15365  DRV_USART_ERROR_ADDRESS /*DOM-IGNORE-BEGIN*/
15366  = ( 1 << 4 ) /* DOM-IGNORE-END*/
15367  } DRV_USART_ERROR ;
15368 // *****************************************************************************
15369 /* USART Client-Specific Driver Status
15370  Summary:
15371  Defines the client-specific status of the USART driver.
15372  Description:
15373  This enumeration defines the client-specific status codes of the USART
15374  driver.
15375  Remarks:
15376  Returned by the DRV_USART_ClientStatus function.
15377 */
15378 
15379 typedef
15380  enum
15381  {
15382  /* An error has occurred.*/
15384  /* The driver is closed, no operations for this client are ongoing,
15385  and/or the given handle is invalid. */
15387  /* The driver is currently busy and cannot start additional operations. */
15389  /* The module is running and ready for additional operations */
15392 // *****************************************************************************
15393 /* USART Driver Transfer Flags
15394  Summary
15395  Specifies the status of the receive or transmit
15396  Description
15397  This type specifies the status of the receive or transmit operation.
15398  Remarks:
15399  More than one of these values may be OR'd together to create a complete
15400  status value. To test a value of this type, the bit of interest must be
15401  ANDed with the value and checked to see if the result is non-zero.
15402 */
15403 
15404 typedef
15405  enum
15406  {
15407  /* Indicates that at least one byte of Data has been received */
15409  /*DOM-IGNORE-BEGIN*/
15410  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15411  ,
15412  /* Indicates that the core driver receiver buffer is empty */
15414  /*DOM-IGNORE-BEGIN*/
15415  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15416  ,
15417  /* Indicates that the core driver transmitter buffer is full */
15419  /*DOM-IGNORE-BEGIN*/
15420  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15421  ,
15422  /* Indicates that the core driver transmitter buffer is empty */
15424  /*DOM-IGNORE-BEGIN*/
15425  = ( 1 << 3 ) /*DOM-IGNORE-END*/
15427 // *****************************************************************************
15428 /* USART Driver Initialization Data
15429  Summary:
15430  Defines the data required to initialize or reinitialize the USART driver
15431  Description:
15432  This data type defines the data required to initialize or reinitialize the
15433  USART driver. If the driver is built statically, the members of this data
15434  structure are statically over-ridden by static override definitions in the
15435  system_config.h file.
15436  Remarks:
15437  None.
15438 */
15439 
15440 typedef
15441  struct
15442  {
15443  /* System module initialization data */
15444  SYS_MODULE_INIT moduleInit ;
15445  /* Identifies USART hardware module (PLIB-level) ID. For a static build of
15446  the driver, this is overridden by DRV_USART_MODULE_ID macro in the
15447  system_config.h header file. */
15448  USART_MODULE_ID usartID ;
15449  /* Identifies the Operation mode of the USART driver. For a static build of
15450  the driver, this is overridden by DRV_USART_MODE_SELECT macro in the
15451  system_config.h header file. */
15453  /* Data required by the operation mode of the driver. For a static build of
15454  the driver, this is overridden by DRV_USART_MODE_DATA macro in the
15455  system_config.h header file. */
15457  /* Flags to enable specific features. Refer to the
15458  description of DRV_USART_INIT_FLAGS for more details. For a static build
15459  of the driver, this is overridden by DRV_USART_FLAGS macro in the
15460  system_config.h header file. */
15461  DRV_USART_INIT_FLAGS flags ;
15462  /* USART module Baud Rate Generator Clock. This typically
15463  the peripheral bus clock frequency. For a static build of the driver,
15464  this is overridden by DRV_USART_BRG_CLOCK macro in the system_config.h
15465  header file. */
15466  uint32_t brgClock ;
15467  /* The initial USART line control settings. For a static build of the driver
15468  this is overridden by the DRV_USART_LINE_CONTROL_SET macro in the
15469  system_config.h header file. */
15470  DRV_USART_LINE_CONTROL lineControl ;
15471  /* Baud Rate value to be used, if not using auto baud. For a static build of
15472  the driver, this is overridden by the DRV_USART_BAUD macro in the
15473  system_config.h header file. */
15474  uint32_t baud ;
15475  /* Handshaking mode. For a static build of the driver, this is overridden by
15476  the DRV_USART_HANDSHAKE_SET macro in the system_config.h header file. */
15477  DRV_USART_HANDSHAKE handshake ;
15478  /* Lines enabled for the USART operation. For a static build of the driver,
15479  this is overridden by the DRV_USART_LINES_ENABLE macro in
15480  the system_config.h header file.
15481  For PPS parts, pin selection in ports overrides this. */
15482  USART_OPERATION_MODE linesEnable ;
15483  /* Interrupt source ID for the transmitter interrupt. For a static build of
15484  the driver, this is overridden by the DRV_USART_TRANSMIT_INTERRUPT_SOURCE
15485  macro in the system_config.h header. */
15486  INT_SOURCE interruptTransmit ;
15487  /* Interrupt source ID for the receiver interrupt. For a static build of
15488  the driver, this is overridden by the DRV_USART_RECEIVE_INTERRUPT_SOURCE
15489  macro in the system_config.h header. */
15490  INT_SOURCE interruptReceive ;
15491  /* Interrupt source ID for the error Interrupt. For a static build of the
15492  driver, this is overridden by the DRV_USART_ERROR_INTERRUPT_SOURCE macro
15493  in the system_config.h header. */
15494  INT_SOURCE interruptError ;
15495  /* This is the receive buffer queue size. This is the maximum
15496  number of read requests that driver will queue. For a
15497  static build of the driver, this is overridden by the
15498  DRV_USART_RECEIVE_QUEUE_SIZE macro in system_config.h */
15499  unsigned int queueSizeReceive ;
15500  /* This is the transmit buffer queue size. This is the maximum
15501  number of write requests that driver will queue. For a
15502  static build of the driver, this is overridden by the
15503  DRV_USART_TRANSMIT_QUEUE_SIZE macro in system_config.h */
15504  unsigned int queueSizeTransmit ;
15505  /* This is the USART transmit DMA channel.
15506  For a static build of the driver, this is overridden by the
15507  DRV_USART_XMIT_DMA_CH_IDXn macro in system_config.h */
15508  DMA_CHANNEL dmaChannelTransmit ;
15509  /* This is the USART receive DMA channel.
15510  For a static build of the driver, this is overridden by the
15511  DRV_USART_RCV_DMA_CH_IDXn macro in system_config.h */
15512  DMA_CHANNEL dmaChannelReceive ;
15513  /* This is the USART transmit DMA channel interrupt.
15514  For a static build of the driver, this is overridden by the
15515  DRV_USART_XMIT_DMA_INT_SRC_IDXn macro in system_config.h */
15516  INT_SOURCE dmaInterruptTransmit ;
15517  /* This is the USART receive DMA channel interrupt.
15518  For a static build of the driver, this is overridden by the
15519  DRV_USART_RCV_DMA_INT_SRC_IDXn macro in system_config.h */
15520  INT_SOURCE dmaInterruptReceive ;
15521  } DRV_USART_INIT ;
15522 //DOM-IGNORE-BEGIN
15523 //DOM-IGNORE-END
15524  // #ifndef _DRV_USART_DEFINITIONS_H
15525 /*******************************************************************************
15526  End of File
15527 */
15528 
15529 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h*/
15530 /* CLOSE_FILE Include File */
15531 
15532 // DOM-IGNORE-BEGIN
15533 // DOM-IGNORE-END
15534 // *****************************************************************************
15535 // *****************************************************************************
15536 // Section: USART Driver Module Interface Routines
15537 // *****************************************************************************
15538 // *****************************************************************************
15539 // *****************************************************************************
15540 /* Function:
15541  SYS_MODULE_OBJ DRV_USART_Initialize
15542  (
15543  const SYS_MODULE_INDEX index,
15544  const SYS_MODULE_INIT * const init
15545  )
15546  Summary:
15547  Initializes the USART instance for the specified driver index.
15548  <p><b>Implementation:</b> Static/Dynamic</p>
15549  Description:
15550  This routine initializes the USART driver instance for the specified driver
15551  index, making it ready for clients to open and use it. The initialization
15552  data is specified by the init parameter. The initialization may fail if the
15553  number of driver objects allocated are insufficient or if the specified
15554  driver instance is already initialized. The driver instance index is
15555  independent of the USART module ID. For example, driver instance 0 can be
15556  assigned to USART2. If the driver is built statically, then some of the
15557  initialization parameters are overridden by configuration macros. Refer to
15558  the description of the DRV_USART_INIT data structure for more details on
15559  which members on this data structure are overridden.
15560  Precondition:
15561  None.
15562  Parameters:
15563  index - Identifier for the instance to be initialized
15564  init - Pointer to a data structure containing any data necessary to
15565  initialize the driver.
15566  Returns:
15567  If successful, returns a valid handle to a driver instance object.
15568  Otherwise, returns SYS_MODULE_OBJ_INVALID.
15569  Example:
15570  <code>
15571  // The following code snippet shows an example USART driver initialization.
15572  // The driver is initialized for normal mode and a baud of 300. The
15573  // receive queue size is set to 2 and transmit queue size is set to 3.
15574  DRV_USART_INIT usartInit;
15575  SYS_MODULE_OBJ objectHandle;
15576  usartInit.baud = 300;
15577  usartInit.mode = DRV_USART_OPERATION_MODE_NORMAL;
15578  usartInit.flags = DRV_USART_INIT_FLAG_NONE;
15579  usartInit.usartID = USART_ID_2;
15580  usartInit.brgClock = 80000000;
15581  usartInit.handshake = DRV_USART_HANDSHAKE_NONE;
15582  usartInit.lineControl = DRV_USART_LINE_CONTROL_8NONE1;
15583  usartInit.interruptError = INT_SOURCE_USART_2_ERROR;
15584  usartInit.interruptReceive = INT_SOURCE_USART_2_RECEIVE;
15585  usartInit.queueSizeReceive = 2;
15586  usartInit.queueSizeTransmit = 3;
15587  usartInit.interruptTransmit = INT_SOURCE_USART_2_TRANSMIT;
15588  usartInit.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
15589  objectHandle = DRV_USART_Initialize(DRV_USART_INDEX_1, (SYS_MODULE_INIT*)&usartInitData);
15590  if (SYS_MODULE_OBJ_INVALID == objectHandle)
15591  {
15592  // Handle error
15593  }
15594  </code>
15595  Remarks:
15596  This routine must be called before any other USART routine is called.
15597  This routine should only be called once during system initialization
15598  unless DRV_USART_Deinitialize is called to deinitialize the driver
15599  instance. This routine will NEVER block for hardware access.
15600 */
15601 
15602 SYS_MODULE_OBJ
15604  const SYS_MODULE_INDEX index ,
15605  const SYS_MODULE_INIT * const init ) ;
15606 // *****************************************************************************
15607 /* Function:
15608  void DRV_USART_Deinitialize( SYS_MODULE_OBJ object )
15609  Summary:
15610  Deinitializes the specified instance of the USART driver module.
15611  <p><b>Implementation:</b> Static/Dynamic</p>
15612  Description:
15613  Deinitializes the specified instance of the USART driver module, disabling
15614  its operation (and any hardware). Invalidates all the internal data.
15615  Precondition:
15616  Function DRV_USART_Initialize should have been called before calling this
15617  function.
15618  Parameters:
15619  object - Driver object handle, returned from the
15620  DRV_USART_Initialize routine
15621  Returns:
15622  None.
15623  Example:
15624  <code>
15625  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15626  SYS_STATUS status;
15627  DRV_USART_Deinitialize(object);
15628  status = DRV_USART_Status(object);
15629  if (SYS_MODULE_DEINITIALIZED != status)
15630  {
15631  // Check again later if you need to know
15632  // when the driver is deinitialized.
15633  }
15634  </code>
15635  Remarks:
15636  Once the Initialize operation has been called, the Deinitialize operation
15637  must be called before the Initialize operation can be called again. This
15638  routine will NEVER block waiting for hardware.
15639 */
15640 
15641 void
15643  SYS_MODULE_OBJ object ) ;
15644 // *****************************************************************************
15645 /* Function:
15646  SYS_STATUS DRV_USART_Status( SYS_MODULE_OBJ object )
15647  Summary:
15648  Gets the current status of the USART driver module.
15649  <p><b>Implementation:</b> Static/Dynamic</p>
15650  Description:
15651  This routine provides the current status of the USART driver module.
15652  Precondition:
15653  Function DRV_USART_Initialize should have been called before calling this
15654  function.
15655  Parameters:
15656  object - Driver object handle, returned from the
15657  DRV_USART_Initialize routine
15658  Returns:
15659  SYS_STATUS_READY - Indicates that the driver is busy with a
15660  previous system level operation and cannot start
15661  another
15662  SYS_STATUS_DEINITIALIZED - Indicates that the driver has been
15663  deinitialized
15664  Example:
15665  <code>
15666  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15667  SYS_STATUS usartStatus;
15668  usartStatus = DRV_USART _Status(object);
15669  if (SYS_STATUS_READY == usartStatus)
15670  {
15671  // This means the driver can be opened using the
15672  // DRV_USART_Open() function.
15673  }
15674  </code>
15675  Remarks:
15676  A driver can opened only when its status is SYS_STATUS_READY.
15677 */
15678 
15679 SYS_STATUS
15681  SYS_MODULE_OBJ object ) ;
15682 // *****************************************************************************
15683 /* Function:
15684  void DRV_USART_TasksTransmit (SYS_MODULE_OBJ object );
15685  Summary:
15686  Maintains the driver's transmit state machine and implements its ISR.
15687  <p><b>Implementation:</b> Static/Dynamic</p>
15688  Description:
15689  This routine is used to maintain the driver's internal transmit state
15690  machine and implement its transmit ISR for interrupt-driven implementations.
15691  In polling mode, this function should be called from the SYS_Tasks
15692  function. In interrupt mode, this function should be called in the transmit
15693  interrupt service routine of the USART that is associated with this USART
15694  driver hardware instance.
15695  Precondition:
15696  The DRV_USART_Initialize routine must have been called for the specified
15697  USART driver instance.
15698  Parameters:
15699  object - Object handle for the specified driver instance (returned from
15700  DRV_USART_Initialize)
15701  Returns:
15702  None.
15703  Example:
15704  <code>
15705  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15706  while (true)
15707  {
15708  DRV_USART_TasksTransmit (object);
15709  // Do other tasks
15710  }
15711  </code>
15712  Remarks:
15713  This routine is normally not called directly by an application. It is
15714  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15715  ISR.
15716  This routine may execute in an ISR context and will never block or access any
15717  resources that may cause it to block.
15718 */
15719 
15720 void
15722  SYS_MODULE_OBJ object ) ;
15723 // *****************************************************************************
15724 /* Function:
15725  void DRV_USART_TasksReceive (SYS_MODULE_OBJ object );
15726  Summary:
15727  Maintains the driver's receive state machine and implements its ISR.
15728  <p><b>Implementation:</b> Static/Dynamic</p>
15729  Description:
15730  This routine is used to maintain the driver's internal receive state machine
15731  and implement its receive ISR for interrupt-driven implementations. In
15732  polling mode, this function should be called from the SYS_Tasks function.
15733  In interrupt mode, this function should be called in the receive interrupt
15734  service routine of the USART that is associated with this USART driver
15735  hardware instance.
15736  Precondition:
15737  The DRV_USART_Initialize routine must have been called for the specified
15738  USART driver instance.
15739  Parameters:
15740  object - Object handle for the specified driver instance (returned from
15741  DRV_USART_Initialize)
15742  Returns:
15743  None.
15744  Example:
15745  <code>
15746  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15747  while (true)
15748  {
15749  DRV_USART_TasksReceive (object);
15750  // Do other tasks
15751  }
15752  </code>
15753  Remarks:
15754  This routine is normally not called directly by an application. It is
15755  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15756  ISR.
15757  This routine may execute in an ISR context and will never block or access any
15758  resources that may cause it to block.
15759 */
15760 
15761 void
15763  SYS_MODULE_OBJ object ) ;
15764 // *****************************************************************************
15765 /* Function:
15766  void DRV_USART_TasksError (SYS_MODULE_OBJ object );
15767  Summary:
15768  Maintains the driver's error state machine and implements its ISR.
15769  <p><b>Implementation:</b> Static/Dynamic</p>
15770  Description:
15771  This routine is used to maintain the driver's internal error state machine
15772  and implement its error ISR for interrupt-driven implementations. In
15773  polling mode, this function should be called from the SYS_Tasks function.
15774  In interrupt mode, this function should be called in the error interrupt
15775  service routine of the USART that is associated with this USART driver
15776  hardware instance.
15777  Precondition:
15778  The DRV_USART_Initialize routine must have been called for the specified
15779  USART driver instance.
15780  Parameters:
15781  object - Object handle for the specified driver instance (returned from
15782  DRV_USART_Initialize)
15783  Returns:
15784  None.
15785  Example:
15786  <code>
15787  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15788  while (true)
15789  {
15790  DRV_USART_TasksError (object);
15791  // Do other tasks
15792  }
15793  </code>
15794  Remarks:
15795  This routine is normally not called directly by an application. It is
15796  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15797  ISR.
15798  This routine may execute in an ISR context and will never block or access any
15799  resources that may cause it to block.
15800 */
15801 
15802 void
15804  SYS_MODULE_OBJ object ) ;
15805 // *****************************************************************************
15806 // *****************************************************************************
15807 // Section: USART Driver Client Routines
15808 // *****************************************************************************
15809 // *****************************************************************************
15810 // *****************************************************************************
15811 /* Function:
15812  DRV_HANDLE DRV_USART_Open
15813  (
15814  const SYS_MODULE_INDEX index,
15815  const DRV_IO_INTENT ioIntent
15816  )
15817  Summary:
15818  Opens the specified USART driver instance and returns a handle to it.
15819  <p><b>Implementation:</b> Static/Dynamic</p>
15820  Description:
15821  This routine opens the specified USART driver instance and provides a
15822  handle that must be provided to all other client-level operations to
15823  identify the caller and the instance of the driver. The ioIntent
15824  parameter defines how the client interacts with this driver instance.
15825  The DRV_IO_INTENT_BLOCKING and DRV_IO_INTENT_NONBLOCKING ioIntent options
15826  additionally affect the behavior of the DRV_USART_Read and
15827  DRV_USART_Write functions. If the ioIntent is DRV_IO_INTENT_NONBLOCKING,
15828  then these function will not block even if the required amount of data could
15829  not be processed. If the ioIntent is DRV_IO_INTENT_BLOCKING, these functions
15830  will block until the required amount of data is processed. If the driver is
15831  configured for polling and bare-metal operation, it will not support
15832  DRV_IO_INTENT_BLOCKING. The driver will operation will always be
15833  non-blocking.
15834  If ioIntent is DRV_IO_INTENT_READ, the client will only be able to read from
15835  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be able
15836  to write to the driver. If the ioIntent is DRV_IO_INTENT_READWRITE, the
15837  client will be able to do both, read and write.
15838  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
15839  exclusive access to this client. The driver cannot be opened by any
15840  other client.
15841  Precondition:
15842  Function DRV_USART_Initialize must have been called before calling this
15843  function.
15844  Parameters:
15845  index - Identifier for the object instance to be opened
15846  intent - Zero or more of the values from the enumeration
15847  DRV_IO_INTENT "ORed" together to indicate the intended use
15848  of the driver. See function description for details.
15849  Returns:
15850  If successful, the routine returns a valid open-instance handle (a number
15851  identifying both the caller and the module instance).
15852  If an error occurs, the return value is DRV_HANDLE_INVALID. Error can occur
15853  - if the number of client objects allocated via DRV_USART_CLIENTS_NUMBER is
15854  insufficient.
15855  - if the client is trying to open the driver but driver has been opened
15856  exclusively by another client.
15857  - if the driver hardware instance being opened is not initialized or is
15858  invalid.
15859  - if the client is trying to open the driver exclusively, but has already
15860  been opened in a non exclusive mode by another client.
15861  - if the driver is not ready to be opened, typically when the initialize
15862  routine has not completed execution.
15863  Example:
15864  <code>
15865  DRV_HANDLE handle;
15866  handle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
15867  if (DRV_HANDLE_INVALID == handle)
15868  {
15869  // Unable to open the driver
15870  // May be the driver is not initialized or the initialization
15871  // is not complete.
15872  }
15873  </code>
15874  Remarks:
15875  The handle returned is valid until the DRV_USART_Close routine is called.
15876  This routine will NEVER block waiting for hardware.If the requested intent
15877  flags are not supported, the routine will return DRV_HANDLE_INVALID. This
15878  function is thread safe in a RTOS application.
15879 */
15880 
15881 DRV_HANDLE
15882  DRV_USART_Open (
15883  const SYS_MODULE_INDEX index ,
15884  const DRV_IO_INTENT ioIntent ) ;
15885 // *****************************************************************************
15886 /* Function:
15887  void DRV_USART_Close( DRV_Handle handle )
15888  Summary:
15889  Closes an opened-instance of the USART driver.
15890  <p><b>Implementation:</b> Static/Dynamic</p>
15891  Description:
15892  This routine closes an opened-instance of the USART driver, invalidating the
15893  handle. Any buffers in the driver queue that were submitted by this client
15894  will be removed. After calling this routine, the handle passed in "handle"
15895  must not be used with any of the remaining driver routines (with one
15896  possible exception described in the "Remarks" section). A new handle must
15897  be obtained by calling DRV_USART_Open before the caller may use the driver
15898  again
15899  Precondition:
15900  The DRV_USART_Initialize routine must have been called for the specified
15901  USART driver instance.
15902  DRV_USART_Open must have been called to obtain a valid opened device handle.
15903  Parameters:
15904  handle - A valid open-instance handle, returned from the driver's
15905  open routine
15906  Returns:
15907  None.
15908  Example:
15909  <code>
15910  DRV_HANDLE handle; // Returned from DRV_USART_Open
15911  DRV_USART_Close(handle);
15912  // After this point, the handle cannot be used with any other function
15913  // except the DRV_USART_ClientStatus function, which can be used to query
15914  // the success status of the DRV_USART_Close function.
15915  while(DRV_USART_CLIENT_STATUS_CLOSED != DRV_USART_ClientStatus(handle));
15916  </code>
15917  Remarks:
15918  Usually there is no need for the client to verify that the Close operation
15919  has completed. The driver will abort any ongoing operations when this
15920  routine is called. However, if it requires additional time to do so in a
15921  non-blocking environment, it will still return from the Close operation but
15922  the handle is now a zombie handle. The client can only call the
15923  DRV_USART_ClientStatus on a zombie handle to track the completion of the
15924  Close operation. The DRV_USART_ClientStatus routine will return
15925  DRV_CLIENT_STATUS_CLOSED when the close operation has completed.
15926 */
15927 
15928 void
15929  DRV_USART_Close (
15930  const DRV_HANDLE handle ) ;
15931 // *****************************************************************************
15932 /*
15933  Function:
15934  DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus( DRV_HANDLE handle )
15935  Summary:
15936  Gets the current client-specific status the USART driver.
15937  <p><b>Implementation:</b> Static/Dynamic</p>
15938  Description:
15939  This function gets the client-specific status of the USART driver associated
15940  with the given handle. This function can be used to check the status of
15941  client after the DRV_USART_Close() function has been called.
15942  Preconditions:
15943  The DRV_USART_Initialize function must have been called.
15944  DRV_USART_Open must have been called to obtain a valid opened device
15945  handle.
15946  Parameters:
15947  handle - Handle returned from the driver's open function.
15948  Returns:
15949  A DRV_USART_CLIENT_STATUS value describing the current status of the
15950  driver.
15951  Example:
15952  <code>
15953  DRV_HANDLE handle; // Returned from DRV_USART_Open
15954  DRV_USART_CLIENT_STATUS status;
15955  status = DRV_USART_ClientStatus(handle);
15956  if( DRV_USART_CLIENT_STATUS_CLOSED != status )
15957  {
15958  // The client had not closed.
15959  }
15960  </code>
15961  Remarks:
15962  This function will not block for hardware access and will immediately return
15963  the current status. This function is thread safe when called in a RTOS
15964  application.
15965 */
15966 
15969  DRV_HANDLE handle ) ;
15970 // *****************************************************************************
15971 // *****************************************************************************
15972 // Section: USART Driver Buffer Queuing Model Interface Routines
15973 // *****************************************************************************
15974 // *****************************************************************************
15975 // *****************************************************************************
15976 /* Function:
15977  void DRV_USART_BufferAddWrite
15978  (
15979  const DRV_HANDLE handle,
15980  DRV_USART_BUFFER_HANDLE * bufferHandle,
15981  void * buffer,
15982  size_t size
15983  );
15984  Summary:
15985  Schedule a non-blocking driver write operation.
15986  <p><b>Implementation:</b> Static/Dynamic</p>
15987  Description:
15988  This function schedules a non-blocking write operation. The function returns
15989  with a valid buffer handle in the bufferHandle argument if the write request
15990  was scheduled successfully. The function adds the request to the hardware
15991  instance transmit queue and returns immediately. While the request is in the
15992  queue, the application buffer is owned by the driver and should not be
15993  modified. On returning, the bufferHandle parameter may be
15994  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
15995  - if a buffer could not be allocated to the request
15996  - if the input buffer pointer is NULL
15997  - if the client opened the driver for read-only
15998  - if the buffer size is 0
15999  - if the transmit queue is full or the queue depth is insufficient
16000  If the requesting client registered an event callback with the driver, the
16001  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16002  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16003  was not processed successfully.
16004  Precondition:
16005  The DRV_USART_Initialize routine must have been called for the specified
16006  USART device instance and the DRV_USART_Status must have returned
16007  SYS_STATUS_READY.
16008  DRV_USART_Open must have been called to obtain a valid opened device handle.
16009  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16010  the DRV_USART_Open call.
16011  Parameters:
16012  handle - Handle of the communication channel as return by the
16013  DRV_USART_Open function.
16014  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16015  buffer - Data to be transmitted.
16016  size - Buffer size in bytes.
16017  Returns:
16018  The bufferHandle parameter will contain the return buffer handle. This will be
16019  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16020  Example:
16021  <code>
16022  MY_APP_OBJ myAppObj;
16023  uint8_t mybuffer[MY_BUFFER_SIZE];
16024  DRV_USART_BUFFER_HANDLE bufferHandle;
16025  // myUSARTHandle is the handle returned
16026  // by the DRV_USART_Open function.
16027  // Client registers an event handler with driver
16028  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16029  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16030  DRV_USART_BufferAddWrite(myUSARThandle, &bufferHandle,
16031  myBuffer, MY_BUFFER_SIZE);
16032  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16033  {
16034  // Error handling here
16035  }
16036  // Event is received when
16037  // the buffer is processed.
16038  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16039  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16040  {
16041  // contextHandle points to myAppObj.
16042  switch(event)
16043  {
16044  case DRV_USART_BUFFER_EVENT_COMPLETE:
16045  // This means the data was transferred.
16046  break;
16047  case DRV_USART_BUFFER_EVENT_ERROR:
16048  // Error handling here.
16049  break;
16050  default:
16051  break;
16052  }
16053  }
16054  </code>
16055  Remarks:
16056  This function is thread safe in a RTOS application. It can be called from
16057  within the USART Driver Buffer Event Handler that is registered by this
16058  client. It should not be called in the event handler associated with another
16059  USART driver instance. It should not otherwise be called directly in an ISR.
16060 */
16061 
16062 void
16064  const DRV_HANDLE handle ,
16065  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16066  void * buffer ,
16067  const size_t size ) ;
16068 // *****************************************************************************
16069 /* Function:
16070  void DRV_USART_AddressedBufferAddWrite
16071  (
16072  const DRV_HANDLE hClient,
16073  DRV_USART_BUFFER_HANDLE * bufferHandle,
16074  uint8_t address,
16075  void * source,
16076  size_t nWords
16077  );
16078  Summary:
16079  Schedule a non-blocking addressed driver write operation.
16080  <p><b>Implementation:</b> Dynamic</p>
16081  Description:
16082  This function schedules a non-blocking addressed write operation. The function returns
16083  with a valid buffer handle in the bufferHandle argument if the addressed write request
16084  was scheduled successfully. The function adds the request to the hardware
16085  instance transmit queue and returns immediately. While the request is in the
16086  queue, the application buffer is owned by the driver and should not be
16087  modified. On returning, the bufferHandle parameter may be
16088  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
16089  - if a buffer could not be allocated to the request
16090  - if the input buffer pointer is NULL
16091  - if the client opened the driver for read-only
16092  - if the buffer size is 0
16093  - if the transmit queue is full or the queue depth is insufficient
16094  If the requesting client registered an event callback with the driver, the
16095  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16096  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16097  was not processed successfully.
16098  Precondition:
16099  The DRV_USART_Initialize routine must have been called for the specified
16100  USART device instance and the DRV_USART_Status must have returned
16101  SYS_STATUS_READY.
16102  DRV_USART_Open must have been called to obtain a valid opened device handle.
16103  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16104  the DRV_USART_Open call.
16105  The operation mode of the driver must be DRV_USART_OPERATION_MODE_ADDRESSED.
16106  Parameters:
16107  hClient - Handle of the communication channel as return by the
16108  DRV_USART_Open function.
16109  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16110  address - Address of the receiver client
16111  source - Data to be transmitted.
16112  size - Buffer size in 16-bit words.
16113  Returns:
16114  The bufferHandle parameter will contain the return buffer handle. This will be
16115  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16116  Example:
16117  <code>
16118  MY_APP_OBJ myAppObj;
16119  uint16_t mybuffer[MY_BUFFER_SIZE];
16120  DRV_USART_BUFFER_HANDLE bufferHandle;
16121  uint8_t clientAddress;
16122  // myUSARTHandle is the handle returned
16123  // by the DRV_USART_Open function.
16124  // Client registers an event handler with driver
16125  clientAddress = 0x60;
16126  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16127  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16128  DRV_USART_AddressedBufferAddWrite(myUSARThandle, &bufferHandle, clientAddress
16129  myBuffer, MY_BUFFER_SIZE);
16130  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16131  {
16132  // Error handling here
16133  }
16134  // Event is received when
16135  // the buffer is processed.
16136  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16137  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16138  {
16139  // contextHandle points to myAppObj.
16140  switch(event)
16141  {
16142  case DRV_USART_BUFFER_EVENT_COMPLETE:
16143  // This means the data was transferred.
16144  break;
16145  case DRV_USART_BUFFER_EVENT_ERROR:
16146  // Error handling here.
16147  break;
16148  default:
16149  break;
16150  }
16151  }
16152  </code>
16153  Remarks:
16154  This function is thread safe in a RTOS application. It can be called from
16155  within the USART Driver Buffer Event Handler that is registered by this
16156  client. It should not be called in the event handler associated with another
16157  USART driver instance. It should not otherwise be called directly in an ISR.
16158  The source buffer should be a 16-bit word aligned buffer.
16159  The 9th bit of the higher byte 16-bit buffer is used to indicate data/address.
16160 */
16161 
16162 void
16164  const DRV_HANDLE hClient ,
16165  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16166  uint8_t address ,
16167  void * source ,
16168  size_t nWords ) ;
16169 // *****************************************************************************
16170 /* Function:
16171  void DRV_USART_BufferAddRead
16172  (
16173  const DRV_HANDLE handle,
16174  DRV_USART_BUFFER_HANDLE * bufferHandle,
16175  void * buffer,
16176  const size_t size
16177  )
16178  Summary:
16179  Schedule a non-blocking driver read operation.
16180  <p><b>Implementation:</b> Static/Dynamic</p>
16181  Description:
16182  This function schedules a non-blocking read operation. The function returns
16183  with a valid buffer handle in the bufferHandle argument if the read request
16184  was scheduled successfully. The function adds the request to the hardware
16185  instance receive queue and returns immediately. While the request is in the
16186  queue, the application buffer is owned by the driver and should not be
16187  modified. The function returns DRV_USART_BUFFER_HANDLE_INVALID in the
16188  bufferHandle argument:
16189  - if a buffer could not be allocated to the request
16190  - if the input buffer pointer is NULL
16191  - if the buffer size is 0
16192  - if the read queue size is full or queue depth is insufficient.
16193  - if the driver handle is invalid
16194  If the requesting client registered an event callback with the driver, the
16195  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16196  processed successfully of DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16197  was not processed successfully.
16198  Precondition:
16199  The DRV_USART_Initialize routine must have been called for the specified
16200  USART device instance and the DRV_USART_Status must have returned
16201  SYS_STATUS_READY.
16202  DRV_USART_Open must have been called to obtain a valid opened device handle.
16203  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16204  the DRV_USART_Open call.
16205  Parameters:
16206  handle - Handle of the communication channel as returned by the
16207  DRV_USART_Open function.
16208  buffer - Buffer where the received data will be stored.
16209  size - Buffer size in bytes.
16210  Returns:
16211  The buffer handle is returned in the bufferHandle argument. This is
16212  DRV_USART_BUFFER_HANDLE_INVALID if the request was not successful.
16213  Example:
16214  <code>
16215  MY_APP_OBJ myAppObj;
16216  uint8_t mybuffer[MY_BUFFER_SIZE];
16217  DRV_USART_BUFFER_HANDLE bufferHandle;
16218  // myUSARTHandle is the handle returned
16219  // by the DRV_USART_Open function.
16220  // Client registers an event handler with driver
16221  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16222  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16223  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle,
16224  myBuffer, MY_BUFFER_SIZE);
16225  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16226  {
16227  // Error handling here
16228  }
16229  // Event is received when
16230  // the buffer is processed.
16231  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16232  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16233  {
16234  // contextHandle points to myAppObj.
16235  switch(event)
16236  {
16237  case DRV_USART_BUFFER_EVENT_COMPLETE:
16238  // This means the data was transferred.
16239  break;
16240  case DRV_USART_BUFFER_EVENT_ERROR:
16241  // Error handling here.
16242  break;
16243  default:
16244  break;
16245  }
16246  }
16247  </code>
16248  Remarks:
16249  This function is thread safe in a RTOS application. It can be called from
16250  within the USART Driver Buffer Event Handler that is registered by the
16251  client. It should not be called in the event handler associated with another
16252  USART driver instance. It should not be called directly in an ISR.
16253 */
16254 
16255 void
16257  const DRV_HANDLE handle ,
16258  DRV_USART_BUFFER_HANDLE * const bufferHandle ,
16259  void * buffer ,
16260  const size_t size ) ;
16261 // *****************************************************************************
16262 /* Function:
16263  void DRV_USART_BufferEventHandlerSet
16264  (
16265  const DRV_HANDLE handle,
16266  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler,
16267  const uintptr_t context
16268  )
16269  Summary:
16270  Allows a client to identify a buffer event handling function for the driver
16271  to call back when queued buffer transfers have finished.
16272  <p><b>Implementation:</b> Static/Dynamic</p>
16273  Description:
16274  This function allows a client to identify a buffer event handling function
16275  for the driver to call back when queued buffer transfers have finished.
16276  When a client calls either the DRV_USART_BufferAddRead or
16277  DRV_USART_BufferAddWrite function, it is provided with a handle identifying
16278  the buffer that was added to the driver's buffer queue. The driver will
16279  pass this handle back to the client by calling "eventHandler" function when
16280  the buffer transfer has completed.
16281  The event handler should be set before the client performs any "buffer add"
16282  operations that could generate events. The event handler once set, persists
16283  until the client closes the driver or sets another event handler (which
16284  could be a "NULL" pointer to indicate no callback).
16285  Precondition:
16286  The DRV_USART_Initialize routine must have been called for the specified
16287  USART driver instance.
16288  DRV_USART_Open must have been called to obtain a valid opened device handle.
16289  Parameters:
16290  handle - A valid open-instance handle, returned from the driver's
16291  open routine
16292  eventHandler - Pointer to the event handler function.
16293  context - The value of parameter will be passed back to the client
16294  unchanged, when the eventHandler function is called. It can
16295  be used to identify any client specific data object that
16296  identifies the instance of the client module (for example,
16297  it may be a pointer to the client module's state structure).
16298  Returns:
16299  None.
16300  Example:
16301  <code>
16302  // myAppObj is an application specific state data object.
16303  MY_APP_OBJ myAppObj;
16304  uint8_t mybuffer[MY_BUFFER_SIZE];
16305  DRV_USART_BUFFER_HANDLE bufferHandle;
16306  // myUSARTHandle is the handle returned
16307  // by the DRV_USART_Open function.
16308  // Client registers an event handler with driver. This is done once
16309  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16310  (uintptr_t)&myAppObj );
16311  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle
16312  myBuffer, MY_BUFFER_SIZE);
16313  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16314  {
16315  // Error handling here
16316  }
16317  // Event Processing Technique. Event is received when
16318  // the buffer is processed.
16319  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16320  DRV_USART_BUFFER_HANDLE handle, uintptr_t context)
16321  {
16322  // The context handle was set to an application specific
16323  // object. It is now retrievable easily in the event handler.
16324  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) context;
16325  switch(event)
16326  {
16327  case DRV_USART_BUFFER_EVENT_COMPLETE:
16328  // This means the data was transferred.
16329  break;
16330  case DRV_USART_BUFFER_EVENT_ERROR:
16331  // Error handling here.
16332  break;
16333  default:
16334  break;
16335  }
16336  }
16337  </code>
16338  Remarks:
16339  If the client does not want to be notified when the queued buffer transfer
16340  has completed, it does not need to register a callback. This function is
16341  thread safe when called in a RTOS application.
16342 */
16343 
16344 void
16346  const DRV_HANDLE handle ,
16347  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler ,
16348  const uintptr_t context ) ;
16349 // *****************************************************************************
16350 /* Function:
16351  DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove( DRV_USART_BUFFER_HANDLE bufferHandle )
16352  Summary:
16353  Removes a requested buffer from the queue.
16354  <p><b>Implementation:</b> Static/Dynamic</p>
16355  Description:
16356  This function removes a specified buffer from the queue.
16357  The client can use this function to delete
16358  1. An unwated stalled buffer.
16359  2. Queued buffers on timeout.
16360  or in any other use case.
16361  Precondition:
16362  The DRV_USART_Initialize routine must have been called for the specified
16363  USART driver instance.
16364  DRV_USART_Open must have been called to obtain a valid opened device handle.
16365  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16366  must have been called and a valid buffer handle returned.
16367  Parameters:
16368  bufferhandle - Handle of the buffer to delete.
16369  Returns:
16370  DRV_USART_BUFFER_RESULT_HANDLE_INVALID - Buffer handle is invalid.
16371  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED - Buffer handle is expired.
16372  DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY - Buffer is removed from the
16373  queue successfully.
16374  DRV_USART_BUFFER_RESULT_REMOVAL_FAILED - Failed to remove buffer from
16375  the queue because of mutex timeout in RTOS environment.
16376  Example:
16377  <code>
16378  // myAppObj is an application specific object.
16379  MY_APP_OBJ myAppObj;
16380  uint8_t mybuffer[MY_BUFFER_SIZE];
16381  DRV_USART_BUFFER_HANDLE bufferHandle;
16382  // myUSARTHandle is the handle returned
16383  // by the DRV_USART_Open function.
16384  // Client registers an event handler with driver. This is done once
16385  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16386  (uintptr_t)&myAppObj );
16387  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16388  myBuffer, MY_BUFFER_SIZE );
16389  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16390  {
16391  // Error handling here
16392  }
16393  // Event Processing Technique. Event is received when
16394  // the buffer is processed.
16395  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16396  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16397  {
16398  switch(event)
16399  {
16400  case DRV_USART_BUFFER_EVENT_COMPLETE:
16401  // This means the data was transferred.
16402  break;
16403  case DRV_USART_BUFFER_EVENT_ERROR:
16404  // Error handling here.
16405  break;
16406  default:
16407  break;
16408  }
16409  }
16410  // Timeout function, where remove queued buffer if it still exists.
16411  void APP_TimeOut(void)
16412  {
16413  DRV_USART_BUFFER_RESULT bufferResult;
16414  bufferResult = DRV_USART_BufferRemove(bufferHandle);
16415  if(DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY == bufferResult)
16416  {
16417  //Buffer removed succesfully from the queue
16418  }
16419  else
16420  {
16421  //Either buffer is invalid or expired.
16422  //Or not able to acquire mutex in RTOS mode.
16423  }
16424  }
16425  </code>
16426  Remarks:
16427  This function is thread safe when used in a RTOS application.
16428 */
16429 
16432  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16433 // *****************************************************************************
16434 /* Function:
16435  size_t DRV_USART_BufferCompletedBytesGet
16436  (
16437  DRV_USART_BUFFER_HANDLE bufferHandle
16438  );
16439  Summary:
16440  Returns the number of bytes that have been processed for the
16441  specified buffer.
16442  <p><b>Implementation:</b> Static/Dynamic</p>
16443  Description:
16444  This function returns number of bytes that have been processed for the
16445  specified buffer. The client can use this function, in a case where the
16446  buffer has terminated due to an error, to obtain the number of bytes that
16447  have been processed. Or in any other use case.
16448  This function can be used for non-DMA buffer transfers only. It cannot be
16449  used when the USART driver is configured to use DMA.
16450  Precondition:
16451  The DRV_USART_Initialize routine must have been called for the specified
16452  USART driver instance.
16453  DRV_USART_Open must have been called to obtain a valid opened device handle.
16454  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16455  must have been called and a valid buffer handle returned.
16456  Parameters:
16457  bufferhandle - Handle for the buffer of which the processed number of bytes
16458  to be obtained.
16459  Returns:
16460  Returns the number of bytes that have been processed for this buffer.
16461  Returns DRV_USART_BUFFER_HANDLE_INVALID for an invalid or an expired
16462  buffer handle.
16463  Example:
16464  <code>
16465  // myAppObj is an application specific object.
16466  MY_APP_OBJ myAppObj;
16467  uint8_t mybuffer[MY_BUFFER_SIZE];
16468  DRV_USART_BUFFER_HANDLE bufferHandle;
16469  // myUSARTHandle is the handle returned
16470  // by the DRV_USART_Open function.
16471  // Client registers an event handler with driver. This is done once
16472  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16473  (uintptr_t)&myAppObj );
16474  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16475  myBuffer, MY_BUFFER_SIZE );
16476  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16477  {
16478  // Error handling here
16479  }
16480  // Event Processing Technique. Event is received when
16481  // the buffer is processed.
16482  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16483  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16484  {
16485  // The context handle was set to an application specific
16486  // object. It is now retrievable easily in the event handler.
16487  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
16488  size_t processedBytes;
16489  switch(event)
16490  {
16491  case DRV_USART_BUFFER_EVENT_COMPLETE:
16492  // This means the data was transferred.
16493  break;
16494  case DRV_USART_BUFFER_EVENT_ERROR:
16495  // Error handling here.
16496  // We can find out how many bytes were processed in this
16497  // buffer before the error occurred.
16498  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
16499  break;
16500  default:
16501  break;
16502  }
16503  }
16504  </code>
16505  Remarks:
16506  This function is thread safe when used in a RTOS application.
16507 */
16508 
16509 size_t
16511  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16512 // *****************************************************************************
16513 /* Function:
16514  size_t DRV_USART_BufferProcessedSizeGet
16515  (
16516  DRV_USART_BUFFER_HANDLE bufferHandle
16517  );
16518  Summary:
16519  This API will be deprecated and not recommended to use.
16520  Use DRV_USART_BufferCompletedBytesGet to get the number of bytes
16521  processed for the specified buffer.
16522  Description:
16523  None.
16524  Precondition:
16525  None.
16526  Parameters:
16527  None.
16528  Returns:
16529  None.
16530  Example:
16531  None.
16532  Remarks:
16533  None.
16534 */
16535 
16536 size_t
16538  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16539 // *****************************************************************************
16540 // *****************************************************************************
16541 // Section: USART Driver File System Model Routines
16542 // *****************************************************************************
16543 // *****************************************************************************
16544 // *****************************************************************************
16545 /* Function:
16546  size_t DRV_USART_Read
16547  (
16548  const DRV_HANDLE handle,
16549  void * buffer,
16550  const size_t numbytes
16551  )
16552  Summary:
16553  Reads data from the USART.
16554  <p><b>Implementation:</b> Static/Dynamic</p>
16555  Description:
16556  This routine reads data from the USART. This function is blocking if the
16557  driver was opened by the client for blocking operation. This function will
16558  not block if the driver was opened by the client for non blocking operation.
16559  If the ioIntent parameter at the time of opening the driver was
16560  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
16561  until) numbytes of bytes have been received or if an error occurred. If there
16562  are buffers queued for receiving data, these buffers will be serviced first. The
16563  function will not return until the requested number of bytes have been read.
16564  If the ioIntent parameter at the time of opening the driver was
16565  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
16566  bytes that were actually read. The function will not wait until numBytes of
16567  bytes have been read. If there are buffer queued for reading data, then the
16568  function will not block and will return immediately with 0 bytes read.
16569  Precondition:
16570  The DRV_USART_Initialize routine must have been called for the specified
16571  USART driver instance.
16572  DRV_USART_Open must have been called to obtain a valid opened device handle.
16573  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16574  the DRV_USART_Open call.
16575  Parameters:
16576  handle - A valid open-instance handle, returned from the driver's
16577  open routine
16578  buffer - Buffer into which the data read from the USART instance
16579  will be placed.
16580  numbytes - Total number of bytes that need to be read from the module
16581  instance (must be equal to or less than the size of the
16582  buffer)
16583  Returns:
16584  Number of bytes actually copied into the caller's buffer. Returns
16585  DRV_USART_READ_ERROR in case of an error.
16586  Example:
16587  <code>
16588  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16589  char myBuffer[MY_BUFFER_SIZE];
16590  unsigned int count;
16591  unsigned int total;
16592  total = 0;
16593  do
16594  {
16595  count = DRV_USART_Read(myUSARTHandle, &myBuffer[total], MY_BUFFER_SIZE - total);
16596  if(count == DRV_USART_READ_ERROR)
16597  {
16598  // There was an error. The DRV_USART_ErrorGet() function
16599  // can be called to find the exact error.
16600  }
16601  total += count;
16602  // Do something else...
16603  } while( total < MY_BUFFER_SIZE );
16604  </code>
16605  Remarks:
16606  This function is thread safe in a RTOS application. If the driver is
16607  configured for polled operation, this it will not support blocking operation
16608  in a bare metal (non-RTOS) application.
16609 */
16610 
16611 size_t
16612  DRV_USART_Read (
16613  const DRV_HANDLE handle ,
16614  void * buffer ,
16615  const size_t numbytes ) ;
16616 // *****************************************************************************
16617 /* Function:
16618  size_t DRV_USART_Write
16619  (
16620  const DRV_HANDLE handle,
16621  void * buffer,
16622  const size_t numbytes
16623  )
16624  Summary:
16625  Writes data to the USART.
16626  <p><b>Implementation:</b> Static/Dynamic</p>
16627  Description:
16628  This routine writes data to the USART. This function is blocking if the
16629  driver was opened by the client for blocking operation. This function will
16630  not block if the driver was opened by the client for non blocking operation.
16631  If the ioIntent parameter at the time of opening the driver was
16632  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
16633  until) numbytes of bytes have been transmitted or if an error occurred. If
16634  there are buffers queued for writing, the function will wait until all the
16635  preceding buffers are completed. Ongoing buffer transmit operations will not
16636  be affected.
16637  If the ioIntent parameter at the time of opening the driver was
16638  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
16639  bytes that were actually accepted for transmission. The function will not
16640  wait until numBytes of bytes have been transmitted. If there a buffers queued
16641  for transmit, the function will not wait and will return immediately with 0
16642  bytes.
16643  Precondition:
16644  The DRV_USART_Initialize routine must have been called for the specified
16645  USART driver instance.
16646  DRV_USART_Open must have been called to obtain a valid opened device handle.
16647  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16648  the DRV_USART_Open call.
16649  Parameters:
16650  handle - A valid open-instance handle, returned from the driver's
16651  open routine
16652  buffer - Buffer containing the data to written.
16653  numbytes - size of the buffer
16654  Returns:
16655  Number of bytes actually written to the driver. Return DRV_USART_WRITE_ERROR
16656  in case of an error.
16657  Example:
16658  <code>
16659  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16660  char myBuffer[MY_BUFFER_SIZE];
16661  int count;
16662  unsigned int total;
16663  total = 0;
16664  do
16665  {
16666  count = DRV_USART_Write(myUSARTHandle, &myBuffer[total],
16667  MY_BUFFER_SIZE - total);
16668  total += count;
16669  // Do something else...
16670  } while( total < MY_BUFFER_SIZE );
16671  </code>
16672  Remarks:
16673  This function is thread safe in a RTOS application. This function is thread
16674  safe in a RTOS application. If the driver is configured for polled
16675  operation, this it will not support blocking operation in a bare metal (non-RTOS)
16676  application.
16677 */
16678 
16679 size_t
16680  DRV_USART_Write (
16681  const DRV_HANDLE handle ,
16682  void * buffer ,
16683  const size_t numbytes ) ;
16684 // *****************************************************************************
16685 /* Function:
16686  DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus( const DRV_HANDLE handle )
16687  Summary:
16688  Returns the transmitter and receiver transfer status.
16689  <p><b>Implementation:</b> Static/Dynamic</p>
16690  Description:
16691  This returns the transmitter and receiver transfer status.
16692  Precondition:
16693  The DRV_USART_Initialize routine must have been called for the specified
16694  USART driver instance.
16695  DRV_USART_Open must have been called to obtain a valid opened device handle.
16696  Parameters:
16697  handle - A valid open-instance handle, returned from the driver's
16698  open routine
16699  Returns:
16700  A DRV_USART_TRANSFER_STATUS value describing the current status
16701  of the transfer.
16702  Example:
16703  <code>
16704  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16705  if (DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle))
16706  {
16707  // Data has been received that can be read
16708  }
16709  </code>
16710  Remarks:
16711  The returned status may contain a value with more than one of the bits
16712  specified in the DRV_USART_TRANSFER_STATUS enumeration set. The caller
16713  should perform an "AND" with the bit of interest and verify if the result is
16714  non-zero (as shown in the example) to verify the desired status bit. This
16715  function is thread safe when called in a RTOS application.
16716 */
16717 
16720  const DRV_HANDLE handle ) ;
16721 // *****************************************************************************
16722 // *****************************************************************************
16723 // Section: USART Driver Byte Model Routines
16724 // *****************************************************************************
16725 // *****************************************************************************
16726 // *****************************************************************************
16727 /* Function:
16728  uint8_t DRV_USART_ReadByte( const DRV_HANDLE handle )
16729  Summary:
16730  Reads a byte of data from the USART.
16731  <p><b>Implementation:</b> Static/Dynamic</p>
16732  Description:
16733  This routine reads a byte of data from the USART.
16734  Precondition:
16735  The DRV_USART_Initialize routine must have been called for the specified
16736  USART driver instance.
16737  DRV_USART_Open must have been called to obtain a valid opened device handle.
16738  The transfer status should be checked to see if the receiver is not empty
16739  before calling this function.
16740  Parameters:
16741  handle - A valid open-instance handle, returned from the driver's
16742  open routine
16743  Returns:
16744  A data byte received by the driver.
16745  Example:
16746  <code>
16747  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16748  char myBuffer[MY_BUFFER_SIZE];
16749  unsigned int numBytes;
16750  numBytes = 0;
16751  do
16752  {
16753  if( DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle) )
16754  {
16755  myBuffer[numBytes++] = DRV_USART_ReadByte(myUSARTHandle);
16756  }
16757  // Do something else...
16758  } while( numBytes < MY_BUFFER_SIZE);
16759  </code>
16760  Remarks:
16761  This function is thread safe when called in a RTOS application. Note that
16762  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
16763  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
16764  DRV_USART_Write functions in a application. Calling the
16765  DRV_USART_ReadByte and DRV_USART_WriteByte functions will disrupt the
16766  processing of any queued buffers.
16767 */
16768 
16769 uint8_t
16771  const DRV_HANDLE handle ) ;
16772 // *****************************************************************************
16773 /* Function:
16774  void DRV_USART_WriteByte( const DRV_HANDLE handle, const uint8_t byte)
16775  Summary:
16776  Writes a byte of data to the USART.
16777  <p><b>Implementation:</b> Static/Dynamic</p>
16778  Description:
16779  This routine writes a byte of data to the USART.
16780  Precondition:
16781  The DRV_USART_Initialize routine must have been called for the specified
16782  USART driver instance.
16783  DRV_USART_Open must have been called to obtain a valid opened device handle.
16784  The transfer status should be checked to see if transmitter is not full
16785  before calling this function.
16786  Parameters:
16787  handle - A valid open-instance handle, returned from the driver's
16788  open routine
16789  byte - Data byte to write to the USART
16790  Returns:
16791  None.
16792  Example:
16793  <code>
16794  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16795  char myBuffer[MY_BUFFER_SIZE];
16796  unsigned int numBytes;
16797  // Preinitialize myBuffer with MY_BUFFER_SIZE bytes of valid data.
16798  numBytes = 0;
16799  while( numBytes < MY_BUFFER_SIZE );
16800  {
16801  if( !(DRV_USART_TRANSFER_STATUS_TRANSMIT_FULL & DRV_USART_TransferStatus(myUSARTHandle)) )
16802  {
16803  DRV_USART_WriteByte(myUSARTHandle, myBuffer[numBytes++]);
16804  }
16805  // Do something else...
16806  }
16807  </code>
16808  Remarks:
16809  This function is thread safe when called in a RTOS application. Note that
16810  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
16811  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
16812  DRV_USART_Write functions in a application. Calling the
16813  DRV_USART_ReadByte and DRV_USART_WriteByte function will disrupt the
16814  processing of any queued buffers.
16815 */
16816 
16817 void
16819  const DRV_HANDLE handle ,
16820  const uint8_t byte ) ;
16821 // *****************************************************************************
16822 /* Function:
16823  unsigned int DRV_USART_ReceiverBufferSizeGet( const DRV_HANDLE handle )
16824  Summary:
16825  Returns the size of the receive buffer.
16826  <p><b>Implementation:</b> Static/Dynamic</p>
16827  Description:
16828  This routine returns the size of the receive buffer.
16829  Precondition:
16830  The DRV_USART_Initialize routine must have been called for the specified
16831  USART driver instance.
16832  DRV_USART_Open must have been called to obtain a valid opened device handle.
16833  Parameters:
16834  handle - A valid open-instance handle, returned from the driver's
16835  open routine
16836  Returns:
16837  Size of the driver's receive buffer, in bytes.
16838  Example:
16839  <code>
16840  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16841  const uint8_t readBuffer[5];
16842  unsigned int size, numBytes = 0;
16843  unsigned int readbufferLen = sizeof(readBuffer);
16844  size = DRV_USART_ReceiverBufferSizeGet(myUSARTHandle);
16845  // Do something based on the receiver buffer size
16846  </code>
16847  Remarks:
16848  Does not account for client queued buffers. This function is thread safe
16849  when called in a RTOS application.
16850 */
16851 
16852 unsigned int
16854  const DRV_HANDLE handle ) ;
16855 // *****************************************************************************
16856 /* Function:
16857  unsigned int DRV_USART_TransmitBufferSizeGet ( const DRV_HANDLE handle )
16858  Summary:
16859  Returns the size of the transmit buffer.
16860  <p><b>Implementation:</b> Static/Dynamic</p>
16861  Description:
16862  This routine returns the size of the transmit buffer and can be used by the
16863  application to determine the number of bytes to write with the
16864  DRV_USART_WriteByte function.
16865  Precondition:
16866  The DRV_USART_Initialize routine must have been called for the specified
16867  USART driver instance.
16868  DRV_USART_Open must have been called to obtain a valid opened device handle.
16869  Parameters:
16870  handle - A valid open-instance handle, returned from the driver's
16871  open routine
16872  Returns:
16873  Size of the driver's transmit buffer, in bytes.
16874  Examples:
16875  <code>
16876  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16877  const uint8_t writeBuffer[5];
16878  unsigned int size, numBytes = 0;
16879  unsigned int writeBufferLen = sizeof(writeBuffer);
16880  size = DRV_USART_TransmitBufferSizeGet (myUSARTHandle);
16881  // Do something based on the transmitter buffer size
16882  </code>
16883  Remarks:
16884  Does not account for client queued buffers. This function is thread safe
16885  when used in a RTOS application.
16886 */
16887 
16888 unsigned int
16890  const DRV_HANDLE handle ) ;
16891 // *****************************************************************************
16892 /* Function:
16893  bool DRV_USART_ReceiverBufferIsEmpty( const DRV_HANDLE handle )
16894  Summary:
16895  Provides the status of the driver's receive buffer.
16896  <p><b>Implementation:</b> Static/Dynamic</p>
16897  Description:
16898  This routine indicates if the driver's receiver buffer is empty. This
16899  function can be used in conjunction with the DRV_USART_Read and
16900  DRV_USART_ReadByte functions.
16901  Precondition:
16902  The DRV_USART_Initialize routine must have been called for the specified
16903  USART driver instance.
16904  DRV_USART_Open must have been called to obtain a valid opened device handle.
16905  Parameters:
16906  handle - A valid open-instance handle, returned from the driver's
16907  open routine
16908  Returns:
16909  true - if the driver's receive buffer is empty
16910  false - if the driver's receive buffer is not empty
16911  Example:
16912  <code>
16913  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16914  char myBuffer[MY_BUFFER_SIZE];
16915  unsigned int numBytes;
16916  numBytes = 0;
16917  while( numBytes < MY_BUFFER_SIZE );
16918  {
16919  if ( !DRV_USART_ReceiverBufferIsEmpty(myUSARTHandle) )
16920  {
16921  if( numBytes < MY_BUFFER_SIZE )
16922  {
16923  myBuffer[numBytes++] = DRV_USART_ReadByte (myUSARTHandle);
16924  }
16925  else
16926  {
16927  break;
16928  }
16929  }
16930  // Do something else while more data is received.
16931  }
16932  </code>
16933  Remarks:
16934  Does not account for client queued buffers. This function is safe thread
16935  safe when used in a RTOS application.
16936 */
16937 
16938 bool
16940  const DRV_HANDLE handle ) ;
16941 // *****************************************************************************
16942 /* Function:
16943  bool DRV_USART_TransmitBufferIsFull( const DRV_HANDLE handle )
16944  Summary:
16945  Provides the status of the driver's transmit buffer.
16946  <p><b>Implementation:</b> Static/Dynamic</p>
16947  Description:
16948  This routine identifies if the driver's transmit buffer is full or not. This
16949  function can be used in conjunction with the DRV_USART_Write and
16950  DRV_USART_WriteByte functions.
16951  Precondition:
16952  The DRV_USART_Initialize routine must have been called for the specified
16953  USART driver instance.
16954  DRV_USART_Open must have been called to obtain a valid opened device handle.
16955  Parameters:
16956  handle - A valid open-instance handle, returned from the driver's
16957  open routine
16958  Returns:
16959  true - if the transmit buffer is full
16960  false - if the transmit buffer is not full
16961  Example:
16962  <code>
16963  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16964  unsigned int numBytes;
16965  int bytesToWrite;
16966  const uint8_t writeBuffer[35] = "1234567890ABCDEFGHIJKLMNOP\n" ;
16967  int writebufferLen = strlen((char *)writeBuffer);
16968  numBytes = 0;
16969  while( numBytes < writebufferLen )
16970  {
16971  if (DRV_USART_TransmitBufferisFull())
16972  {
16973  // Do something else until there is some room in the driver's Transmit buffer.
16974  }
16975  else
16976  {
16977  DRV_USART_WriteByte(myUSARTHandle, writeBuffer[numBytes++]);
16978  }
16979  }
16980  </code>
16981  Remarks:
16982  Does not account for client queued buffers. This function is thread safe
16983  when called in a RTOS application.
16984 */
16985 
16986 bool
16988  const DRV_HANDLE handle ) ;
16989 // *****************************************************************************
16990 /* Function:
16991  void DRV_USART_ByteTransmitCallbackSet
16992  (
16993  const SYS_MODULE_INDEX index,
16994  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
16995  )
16996  Summary:
16997  Registers a callback function for byte transmit event.
16998  Description:
16999  This function allows a transmit callback function to be registered with the
17000  driver. The callback function is invoked when a byte has been transmitted
17001  using DRV_USART_WriteByte () function.
17002  The callback function should be registered with the driver prior to any
17003  writes to the driver. The callback functionality is available only in the
17004  interrupt mode of operation. The driver clears the interrupt after invoking
17005  the callback function.
17006  Precondition:
17007  The DRV_USART_Initialize routine must have been called for the specified
17008  USART driver instance.
17009  Parameters:
17010  index - Identifier for the object instance to be opened
17011  eventHandler - Pointer to the event handler function.
17012  Returns:
17013  None.
17014  Example:
17015  <code>
17016  // myAppObj is an application specific state data object.
17017  MY_APP_OBJ myAppObj;
17018  uint8_t mybuffer[MY_BUFFER_SIZE];
17019  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17020  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17021  (uintptr_t)&myAppObj );
17022  // Register an event handler with driver. This is done once
17023  DRV_USART_ByteTransmitCallbackSet (DRV_USART_INDEX_0, APP_USARTTransmitEventHandler);
17024  DRV_USART_WriteByte (myUSARThandle, myBuffer[0]);
17025  // Event Processing Technique. Event is received when
17026  // the byte is transmitted.
17027  void APP_USARTTransmitEventHandler (const SYS_MODULE_INDEX index)
17028  {
17029  // Byte has been transmitted. Handle the event.
17030  }
17031  </code>
17032  Remarks:
17033  None
17034 */
17035 
17036 void
17038  const SYS_MODULE_INDEX index ,
17039  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17040 // *****************************************************************************
17041 /* Function:
17042  void DRV_USART_ByteReceiveCallbackSet
17043  (
17044  const SYS_MODULE_INDEX index,
17045  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17046  )
17047  Summary:
17048  Registers receive callback function for byte receive event.
17049  Description:
17050  This function allows a receive callback function to be registered with the
17051  driver. The callback function is invoked when a byte has been received. The
17052  received byte can then be read using DRV_USART_ReadByte() function.
17053  The callback function should be registered with the driver as part of the
17054  initialization. The callback functionality is available only in the
17055  interrupt mode of operation. The driver clears the interrupt after invoking
17056  the callback function.
17057  Precondition:
17058  The DRV_USART_Initialize routine must have been called for the specified
17059  USART driver instance.
17060  Parameters:
17061  index - Identifier for the object instance to be opened
17062  eventHandler - Pointer to the event handler function.
17063  Returns:
17064  None.
17065  Example:
17066  <code>
17067  // myAppObj is an application specific state data object.
17068  MY_APP_OBJ myAppObj;
17069  uint8_t mybuffer[MY_BUFFER_SIZE];
17070  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17071  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17072  (uintptr_t)&myAppObj );
17073  // Register an event handler with driver. This is done once
17074  DRV_USART_ByteReceiveCallbackSet(DRV_USART_INDEX_0, APP_USARTReceiveEventHandler);
17075  // Event Processing Technique. Event is received when
17076  // a byte is received.
17077  void APP_USARTReceiveEventHandler(const SYS_MODULE_INDEX index)
17078  {
17079  // Byte has been Received. Handle the event.
17080  // Read byte using DRV_USART_ReadByte ()
17081  // DRV_USART_ReceiverBufferIsEmpty() function can be used to
17082  // check if the receiver buffer is empty.
17083  }
17084  </code>
17085  Remarks:
17086  None
17087 */
17088 
17089 void
17091  const SYS_MODULE_INDEX index ,
17092  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17093 // *****************************************************************************
17094 /* Function:
17095  void DRV_USART_ByteErrorCallbackSet
17096  (
17097  const SYS_MODULE_INDEX index,
17098  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17099  )
17100  Summary:
17101  Registers callback to handle for byte error events.
17102  Description:
17103  This function allows a callback function to be registered with the driver
17104  to handle the error events occurring in the transmit/receive path during
17105  byte transfers.
17106  The callback function should be registered as part of the initialization.
17107  The callback functionality is available only in the interrupt mode of
17108  operation. The driver clears the interrupt after invoking the callback
17109  function.
17110  Precondition:
17111  The DRV_USART_Initialize routine must have been called for the specified
17112  USART driver instance.
17113  Parameters:
17114  index - Identifier for the object instance to be opened
17115  eventHandler - Pointer to the event handler function.
17116  Returns:
17117  None.
17118  Example:
17119  <code>
17120  // myAppObj is an application specific state data object.
17121  MY_APP_OBJ myAppObj;
17122  uint8_t mybuffer[MY_BUFFER_SIZE];
17123  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17124  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17125  (uintptr_t)&myAppObj );
17126  // Register an event handler with driver. This is done once
17127  DRV_USART_ByteErrorCallbackSet (DRV_USART_INDEX_0, APP_USARTErrorEventHandler);
17128  // Event Processing Technique.
17129  void APP_USARTErrorEventHandler(const SYS_MODULE_INDEX index)
17130  {
17131  // Error has occurred. Handle the event.
17132  }
17133  </code>
17134  Remarks:
17135  None
17136 */
17137 
17138 void
17140  const SYS_MODULE_INDEX index ,
17141  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17142 // *****************************************************************************
17143 // *****************************************************************************
17144 // Section: USART Driver Setup and Status Routines
17145 // *****************************************************************************
17146 // *****************************************************************************
17147 // *****************************************************************************
17148 /* Function:
17149  DRV_USART_ERROR DRV_USART_ErrorGet(DRV_HANDLE client);
17150  Summary:
17151  This function returns the error(if any) associated with the last client
17152  request.
17153  <p><b>Implementation:</b> Static/Dynamic</p>
17154  Description:
17155  This function returns the error(if any) associated with the last client
17156  request. DRV_USART_Read and DRV_USART_Write will update the client
17157  error status when these functions return DRV_USART_TRANSFER_ERROR. If the
17158  driver send a DRV_USART_BUFFER_EVENT_ERROR to the client, the client can
17159  call this function to know the error cause. The error status will be updated
17160  on every operation and should be read frequently (ideally immediately after
17161  the driver operation has completed) to know the relevant error status.
17162  Precondition:
17163  The DRV_USART_Initialize routine must have been called for the specified
17164  USART driver instance.
17165  DRV_USART_Open must have been called to obtain a valid opened device handle.
17166  Parameters:
17167  bufferhandle - Handle of the buffer of which the processed number of bytes
17168  to be obtained.
17169  Returns:
17170  A DRV_USART_ERROR type indicating last known error status.
17171  Example:
17172  <code>
17173  // myAppObj is an application specific object.
17174  MY_APP_OBJ myAppObj;
17175  uint8_t mybuffer[MY_BUFFER_SIZE];
17176  DRV_USART_BUFFER_HANDLE bufferHandle;
17177  // myUSARTHandle is the handle returned
17178  // by the DRV_USART_Open function.
17179  // Client registers an event handler with driver. This is done once.
17180  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
17181  (uintptr_t)&myAppObj );
17182  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
17183  myBuffer, MY_BUFFER_SIZE );
17184  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
17185  {
17186  // Error handling here
17187  }
17188  // Event Processing Technique. Event is received when
17189  // the buffer is processed.
17190  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
17191  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
17192  {
17193  // The context handle was set to an application specific
17194  // object. It is now retrievable easily in the event handler.
17195  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
17196  size_t processedBytes;
17197  switch(event)
17198  {
17199  case DRV_USART_BUFFER_EVENT_COMPLETE:
17200  // This means the data was transferred.
17201  break;
17202  case DRV_USART_BUFFER_EVENT_ERROR:
17203  // Error handling here.
17204  // We can find out how many bytes were processed in this
17205  // buffer before the error occurred. We can also find
17206  // the error cause.
17207  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
17208  if(DRV_USART_ERROR_RECEIVE_OVERRUN == DRV_USART_ErrorGet(myUSARTHandle))
17209  {
17210  // There was an receive over flow error.
17211  // Do error handling here.
17212  }
17213  break;
17214  default:
17215  break;
17216  }
17217  }
17218  </code>
17219  Remarks:
17220  It is the client's responsibility to make sure that the error status is
17221  obtained frequently. The driver will update the client error status
17222  regardless of whether this has been examined by the client. This function
17223  is thread safe when used in a RTOS application.
17224 */
17225 
17228  const DRV_HANDLE client ) ;
17229 // *****************************************************************************
17230 /* Function:
17231  void DRV_USART_BaudSet(DRV_HANDLE client, uint32_t baud);
17232  Summary:
17233  This function changes the USART module baud to the specified value.
17234  <p><b>Implementation:</b> Static/Dynamic</p>
17235  Description:
17236  This function changes the USART module baud to the specified value. Any
17237  queued buffer requests will be processed at the updated baud. The USART
17238  driver operates at the baud specified in DRV_USART_Initialize function
17239  unless the DRV_USART_BaudSet function is called to change the baud.
17240  Precondition:
17241  The DRV_USART_Initialize routine must have been called for the specified
17242  USART driver instance.
17243  DRV_USART_Open must have been called to obtain a valid opened device handle.
17244  Parameters:
17245  handle - client handle returned by DRV_USART_Open function.
17246  baud - desired baud.
17247  Returns:
17248  None.
17249  Example:
17250  <code>
17251  // myUSARTHandle is the handle returned
17252  // by the DRV_USART_Open function.
17253  DRV_USART_BaudSet(myUSARTHandle, 9600);
17254  </code>
17255  Remarks:
17256  The implementation of this function, in this release of the driver, changes
17257  the baud immediately. This may interrupt on-going data transfer. It is
17258  recommended that the driver be opened exclusively if this function is to be
17259  called. This function is thread safe when used in a RTOS application.
17260 */
17261 
17264  const DRV_HANDLE client ,
17265  uint32_t baud ) ;
17266 // *****************************************************************************
17267 /* Function:
17268  void DRV_USART_LineControlSet
17269  (
17270  DRV_HANDLE client,
17271  DRV_USART_LINE_CONTROL lineControl
17272  );
17273  Summary:
17274  This function changes the USART module line control to the specified value.
17275  <p><b>Implementation:</b> Static/Dynamic</p>
17276  Description:
17277  This function changes the USART module line control parameters to the
17278  specified value. Any queued buffer requests will be processed at the
17279  updated line control parameters. The USART driver operates at the line
17280  control parameters specified in DRV_USART_Initialize function unless the
17281  DRV_USART_LineControlSet function is called to change the line control
17282  parameters.
17283  Precondition:
17284  The DRV_USART_Initialize routine must have been called for the specified
17285  USART driver instance.
17286  DRV_USART_Open must have been called to obtain a valid opened device handle.
17287  Parameters:
17288  handle - client handle returned by DRV_USART_Open function.
17289  lineControl - line control parameters.
17290  Returns:
17291  DRV_USART_LINE_CONTROL_SET_SUCCESS if the function was successful. Returns
17292  DRV_HANDLE_INVALID if the client handle is not valid.
17293  Example:
17294  <code>
17295  // myUSARTHandle is the handle returned
17296  // by the DRV_USART_Open function.
17297  DRV_USART_LineControlSet(myUSARTHandle, DRV_USART_LINE_CONTROL_8NONE1);
17298  </code>
17299  Remarks:
17300  The implementation of this function, in this release of the driver, changes
17301  the line control immediately. This may interrupt on-going data transfer. It
17302  is recommended that the driver be opened exclusively if this function is to
17303  be called. This function is thread safe when called in a RTOS application.
17304 */
17305 
17308  const DRV_HANDLE client ,
17309  const DRV_USART_LINE_CONTROL lineControl ) ;
17310 //DOM-IGNORE-BEGIN
17311 //DOM-IGNORE-END
17312  // #ifndef _DRV_USART_H
17313 /*******************************************************************************
17314  End of File
17315 */
17316 
17317 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h*/
17318 /* CLOSE_FILE Include File */
17319 
17320 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h */
17321 /*******************************************************************************
17322  USART Driver Variant Mapping
17323  Company:
17324  Microchip Technology Inc.
17325  File Name:
17326  drv_usart_variant_mapping.h
17327  Summary:
17328  USART Driver Variant Mapping
17329  Description:
17330  This file provides feature and build variant mapping macros allowing the
17331  driver to easily be built with different implementation variations based
17332  on static build-time configuration selections.
17333 *******************************************************************************/
17334 //DOM-IGNORE-BEGIN
17335 /*******************************************************************************
17336 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
17337 Microchip licenses to you the right to use, modify, copy and distribute
17338 Software only when embedded on a Microchip microcontroller or digital signal
17339 controller that is integrated into your product or third party product
17340 (pursuant to the sublicense terms in the accompanying license agreement).
17341 You should refer to the license agreement accompanying this Software for
17342 additional information regarding your rights and obligations.
17343 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17344 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17345 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17346 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17347 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17348 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17349 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17350 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17351 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17352 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17353 *******************************************************************************/
17354 //DOM-IGNORE-END
17355 #ifndef _DRV_USART_FEATURE_MAPPING_H
17356 #define _DRV_USART_FEATURE_MAPPING_H
17357 // *****************************************************************************
17358 // *****************************************************************************
17359 // Section: Interrrupt Variations
17360 // *****************************************************************************
17361 // *****************************************************************************
17362 /* Mapping of the interrupt mode variations
17363 */
17364  /* Driver is configured for polled mode */
17365 #define _DRV_USART_InterruptSourceIsEnabled( source ) false
17366 #define _DRV_USART_InterruptSourceEnable( source )
17367 #define _DRV_USART_InterruptSourceDisable( source ) false
17368 #define _DRV_USART_InterruptSourceStatusClear( source ) SYS_INT_SourceStatusClear ( source )
17369 #define _DRV_USART_SEM_POST( x ) OSAL_SEM_Post ( x )
17370 #define _DRV_USART_TAKE_MUTEX( x , y ) OSAL_MUTEX_Lock ( x , y )
17371 #define _DRV_USART_RELEASE_MUTEX( x ) OSAL_MUTEX_Unlock ( x )
17372 #define _SYS_DMA_ChannelForceStart( channelHandle ) SYS_DMA_ChannelForceStart ( channelHandle )
17373  /* This means the driver is being built in a baremetal application.
17374  We cannot let a client open the driver in blocking mode */
17375 #define _DRV_USART_ALWAYS_NON_BLOCKING ( DRV_IO_INTENT_NONBLOCKING )
17376 // *****************************************************************************
17377 // *****************************************************************************
17378 // Section: Buffer Queue support
17379 // *****************************************************************************
17380 // *****************************************************************************
17381 /* Mapping of macros for buffer queue support
17382 */
17383  /* We dont need buffer queues or byte model support */
17384 #define _DRV_USART_TRANSMIT_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteTransmitTasks ( x )
17385 #define _DRV_USART_RECEIVE_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteReceiveTasks ( x )
17386 #define _DRV_USART_ERROR_TASKS( x ) _DRV_USART_ByteErrorTasks ( x )
17387 #define _DRV_USART_CLIENT_BUFFER_QUEUE_OBJECTS_REMOVE( x ) true
17388 #define _DRV_USART_ByteModelInterruptSourceEnable( source )
17389 // *****************************************************************************
17390 // *****************************************************************************
17391 // Initializtion Parameter Static Overrides
17392 // *****************************************************************************
17393 // *****************************************************************************
17394  //_DRV_USART_FEATURE_MAPPING_H
17395 /*******************************************************************************
17396  End of File
17397 */
17398 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h*/
17399 /* CLOSE_FILE Include File */
17400 
17401 #include "system/clk/sys_clk.h"
17402 #include "system/int/sys_int.h"
17403 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h */
17404 /*******************************************************************************
17405  Debug System Services Library Header
17406  Company:
17407  Microchip Technology Inc.
17408 
17409  File Name:
17410  sys_debug.h
17411  Summary:
17412  Defines the common debug definitions and interfaces used by MPLAB Harmony
17413  libraries to report errors and debug information to the user.
17414  Description:
17415  This header file defines the common debug definitions and interface macros
17416  (summary below) and prototypes used by MPLAB Harmony libraries to report
17417  errors and debug information to the user.
17418  *******************************************************************************/
17419 //DOM-IGNORE-BEGIN
17420 /*******************************************************************************
17421 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
17422 Microchip licenses to you the right to use, modify, copy and distribute
17423 Software only when embedded on a Microchip microcontroller or digital signal
17424 controller that is integrated into your product or third party product
17425 (pursuant to the sublicense terms in the accompanying license agreement).
17426 You should refer to the license agreement accompanying this Software for
17427 additional information regarding your rights and obligations.
17428 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17429 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17430 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17431 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17432 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17433 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17434 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17435 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17436 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17437 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17438  *******************************************************************************/
17439 //DOM-IGNORE-END
17440 #ifndef _SYS_DEBUG_H
17441 #define _SYS_DEBUG_H
17442 #include "C:\microchip\harmony\v2_06\framework\system\system.h"
17443  /* LDRA full path */
17444 // This should be defined in system_config.h. It is added here as a build safe-guard.
17445 #define SYS_DEBUG_BUFFER_DMA_READY
17446 // *****************************************************************************
17447 // *****************************************************************************
17448 // Section: SYS DEBUG Data Types
17449 // *****************************************************************************
17450 // *****************************************************************************
17451 // *****************************************************************************
17452 /* SYS_ERROR_LEVEL enumeration
17453  Summary:
17454  System error message priority levels.
17455  Description:
17456  This enumeration defines the supported system error message priority values.
17457  Remarks:
17458  Used by debug message macros to compare individual message priority against
17459  a global system-wide error message priority level to determine if an
17460  individual message should be displayed.
17461 */
17462 
17463 typedef
17464  enum
17465  {
17466  /* Errors that have the potential to cause a system crash. */
17468  /* Errors that have the potential to cause incorrect behavior. */
17470  /* Warnings about potentially unexpected behavior or side effects. */
17472  /* Information helpful to understanding potential errors and warnings. */
17474  /* Verbose information helpful during debugging and testing. */
17476  } SYS_ERROR_LEVEL ;
17477 // DOM-IGNORE-BEGIN
17478 // *****************************************************************************
17479 /* Do not use this variable directly. Use SYS_DEBUG_ErrorLevelGet or
17480  SYS_DEBUG_ErrorLevelSet functions to access this value.
17481 */
17482 
17483 extern SYS_ERROR_LEVEL
17484  gblErrLvl ;
17485 // DOM-IGNORE-END
17486 // *****************************************************************************
17487 /* SYS Debug Module Index Number
17488  Summary:
17489  Debug System Service index.
17490  Description:
17491  This constant defines a symbolic name for the debug system service index.
17492  Remarks:
17493  There can only be a single debug system service instance in the system.
17494 */
17495 #define SYS_DEBUG_INDEX_0 0
17496 // *****************************************************************************
17497 /* SYS Debug Initialize structure
17498  Summary:
17499  Defines the data required to initialize the debug system service.
17500  Description:
17501  This structure defines the data required to initialize the debug system
17502  service.
17503  Remarks:
17504  None.
17505 */
17506 
17507 typedef
17508  struct
17509  {
17510  /* System module initialization */
17511  SYS_MODULE_INIT moduleInit ;
17512  /* Initial system error level setting. */
17513  SYS_ERROR_LEVEL errorLevel ;
17514  /* Console index to receive debug messages */
17515  SYS_MODULE_INDEX consoleIndex ;
17516  } SYS_DEBUG_INIT ;
17517 // *****************************************************************************
17518 // *****************************************************************************
17519 // Section: SYS DEBUG Functions
17520 // *****************************************************************************
17521 // *****************************************************************************
17522 // *****************************************************************************
17523 /* Function:
17524  SYS_MODULE_OBJ SYS_DEBUG_Initialize( const SYS_MODULE_INDEX index,
17525  const SYS_MODULE_INIT * const init )
17526  Summary:
17527  Initializes the global error level and specific module instance.
17528  Description:
17529  This function initializes the global error level. It also initializes any
17530  internal system debug module data structures.
17531  Precondition:
17532  None.
17533  Parameters:
17534  index - Index for the instance to be initialized
17535  init - Pointer to a data structure containing any data necessary
17536  to initialize the debug service. This pointer may be null
17537  if no data is required because static overrides have
17538  been provided.
17539  Returns:
17540  If successful, returns a valid handle to an object. Otherwise, it
17541  returns SYS_MODULE_OBJ_INVALID.
17542  Example:
17543  <code>
17544  SYS_MODULE_OBJ objectHandle;
17545  SYS_DEBUG_INIT debugInit =
17546  {
17547  .moduleInit = {0},
17548  .errorLevel = SYS_ERROR_DEBUG,
17549  };
17550  objectHandle = SYS_Debug_Initialize (SYS_DEBUG_CONSOLE, (SYS_MODULE_INIT*)&debugInit);
17551  if (SYS_MODULE_OBJ_INVALID == objectHandle)
17552  {
17553  // Handle error
17554  }
17555  </code>
17556  Remarks:
17557  This routine should only be called once during system initialization. If the
17558  system was already initialized it safely returns without causing any disturbance.
17559 */
17560 
17561 SYS_MODULE_OBJ
17563  const SYS_MODULE_INDEX index ,
17564  const SYS_MODULE_INIT * const init ) ;
17565 // *****************************************************************************
17566 /* Function:
17567  void SYS_DEBUG_Reinitialize( SYS_MODULE_OBJ object,
17568  const SYS_MODULE_INIT * const init )
17569  Summary:
17570  Reinitializes and refreshes the data structure for the instance of the
17571  Debug module.
17572  Description:
17573  This function reinitializes and refreshes the data structure for the instance
17574  of the Debug module using the supplied data.
17575  Precondition:
17576  The SYS_DEBUG_Initialize function should have been called before calling
17577  this function.
17578  Parameters:
17579  object - Identifies the SYS DEBUG Object returned by the Initialize
17580  interface
17581  init - Pointer to the data structure containing any data
17582  necessary to initialize the hardware
17583  Returns:
17584  None
17585  Example:
17586  <code>
17587  SYS_MODULE_OBJ objectHandle;
17588  // Populate the console initialization structure
17589  SYS_DEBUG_INIT dbgInit =
17590  {
17591  .moduleInit = {0},
17592  .errorLevel = SYS_ERROR_DEBUG,
17593  };
17594  SYS_DEBUG_Reinitialize (objectHandle, (SYS_MODULE_INIT*)&dbgInit);
17595  </code>
17596  Remarks:
17597  This operation uses the same initialization data structure as the
17598  SYS_DEBUG_Initialize operation. This function can be called multiple times
17599  to reinitialize the module.
17600 */
17601 
17602 void
17604  SYS_MODULE_OBJ object ,
17605  const SYS_MODULE_INIT * const init ) ;
17606 // *****************************************************************************
17607 /* Function:
17608  void SYS_DEBUG_Deinitialize( SYS_MODULE_OBJ object )
17609  Summary:
17610  Deinitializes the specific module instance of the Debug module.
17611  Description:
17612  This function deinitializes the specific module instance disabling its
17613  operation (and any hardware for driver modules). Resets all of the internal
17614  data structures and fields for the specified instance to the default settings.
17615  Precondition:
17616  The SYS_DEBUG_Initialize function should have been called before calling
17617  this function.
17618  Parameters:
17619  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
17620  Returns:
17621  None.
17622  Example:
17623  <code>
17624  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
17625  SYS_DEBUG_Deinitialize (object);
17626  </code>
17627  Remarks:
17628  Once the Initialize operation has been called, the Deinitialize
17629  operation must be called before the Initialize operation can be called
17630  again.
17631 */
17632 
17633 void
17635  SYS_MODULE_OBJ object ) ;
17636 // *****************************************************************************
17637 /* Function:
17638  void SYS_DEBUG_Tasks( SYS_MODULE_OBJ object )
17639  Summary:
17640  Maintains the debug module's state machine.
17641  Description:
17642  This function is used to maintain the debug module's internal state
17643  machine and implement its ISR for interrupt-driven implementations.
17644  Precondition:
17645  The SYS_DEBUG_Initialize function must have been called for the specified
17646  CONSOLE driver instance.
17647  Parameters:
17648  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
17649  Returns:
17650  None.
17651  Example:
17652  <code>
17653  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
17654  while (true)
17655  {
17656  SYS_DEBUG_Tasks (object);
17657  // Do other tasks
17658  }
17659  </code>
17660  Remarks:
17661  This function is normally not called directly by an application. It is
17662  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
17663  ISR.
17664 */
17665 
17666 void
17667  SYS_DEBUG_Tasks (
17668  SYS_MODULE_OBJ object ) ;
17669 // *****************************************************************************
17670 /* Function:
17671  SYS_STATUS SYS_DEBUG_Status( SYS_MODULE_OBJ object )
17672  Summary:
17673  Returns status of the specific instance of the debug service module.
17674  Description:
17675  This function returns the status of the specific debug service module
17676  instance.
17677  Precondition:
17678  The SYS_CONSOLE_Initialize function should have been called before calling
17679  this function.
17680  Parameters:
17681  object - Debug module object handle, returned from SYS_DEBUG_Initialize
17682  Returns:
17683  * SYS_STATUS_READY - Indicates that the module is running and
17684  ready to service requests. Any value greater
17685  than SYS_STATUS_READY is also a normal
17686  running state in which the module is ready
17687  to accept new operations.
17688  * SYS_STATUS_BUSY - Indicates that the module is busy with a
17689  previous system level operation and cannot
17690  start another.
17691  * SYS_STATUS_ERROR - Indicates that the module is in an error
17692  state. Any value less than SYS_STATUS_ERROR
17693  is also an error state.
17694  * SYS_STATUS_UNINITIALIZED - Indicates that the module has not been
17695  initialized or has been deinitialized.
17696  Example:
17697  <code>
17698  SYS_MODULE_OBJ object; // Returned from SYS_CONSOLE_Initialize
17699  SYS_STATUS debugStatus;
17700  debugStatus = SYS_DEBUG_Status (object);
17701  if (SYS_STATUS_ERROR >= debugStatus)
17702  {
17703  // Handle error
17704  }
17705  </code>
17706  Remarks:
17707  None.
17708 */
17709 
17710 SYS_STATUS
17712  SYS_MODULE_OBJ object ) ;
17713 // *****************************************************************************
17714 // *****************************************************************************
17715 // Section: SYS DEBUG Console Functions
17716 // *****************************************************************************
17717 // *****************************************************************************
17718 // *****************************************************************************
17719 /* Function:
17720  SYS_DEBUG_Message( const char* message );
17721  Summary:
17722  Prints a message to the console regardless of the system error level.
17723  Description:
17724  This function prints a message to the console regardless of the system
17725  error level. It can be used as an implementation of the SYS_MESSAGE and
17726  SYS_DEBUG_MESSAGE macros.
17727  Precondition:
17728  SYS_DEBUG_Initialize must have returned a valid object handle and the
17729  SYS_DEBUG_Tasks function must be called by the system to complete the
17730  message request.
17731  Parameters:
17732  message - Pointer to a message string to be displayed.
17733  Returns:
17734  None.
17735  Example:
17736  <code>
17737  // In system_config.h:
17738 #define SYS_MESSAGE(message) SYS_DEBUG_Message(message)
17739 
17740  // In source (.c) files:
17741  SYS_MESSAGE("My Message\n\r");
17742  </code>
17743  Remarks:
17744  Do not call this function directly. Call the SYS_MESSAGE or
17745  SYS_DEBUG_MESSAGE macros instead.
17746 
17747  The default SYS_MESSAGE and SYS_DEBUG_MESSAGE macro definitions remove
17748  the messages and message function calls from the source code. To access
17749  and utilize the messages, define the SYS_DEBUG_USE_CONSOLE macro or
17750  override the definitions of the individual macros.
17751 */
17752 
17753 void
17755  const char * message ) ;
17756 // *****************************************************************************
17757 /* Function:
17758  SYS_DEBUG_Print( const char* format, ... )
17759  Summary:
17760  Formats and prints a message with a variable number of arguments to the
17761  console regardless of the system error level.
17762  Description:
17763  This function formats and prints a message with a variable number of
17764  arguments to the console regardless of the system error level. It can be
17765  used to implement the SYS_PRINT and SYS_DEBUG_PRINT macros.
17766  Precondition:
17767  SYS_DEBUG_Initialize must have returned a valid object handle and the
17768  SYS_DEBUG_Tasks function must be called by the system to complete the
17769  message request.
17770  Parameters:
17771  format - Pointer to a buffer containing the format string for
17772  the message to be displayed.
17773  ... - Zero or more optional parameters to be formated as
17774  defined by the format string.
17775  Returns:
17776  None.
17777  Example:
17778  <code>
17779  // In system_config.h
17780 #define SYS_PRINT(format, ...) SYS_DEBUG_Print(format, ##__VA_ARG__)
17781 
17782  // In source code
17783  int result;
17784 
17785  result = SomeOperation();
17786  if (result > MAX_VALUE)
17787  {
17788  SYS_PRINT("Result of %d exceeds max value\r\n", result);
17789  }
17790  </code>
17791  Remarks:
17792  The format string and arguments follow the printf convention.
17793 
17794  Do not call this function directly. Call the SYS_PRINT or SYS_DEBUG_PRINT
17795  macros instead.
17796 
17797  The default SYS_PRINT and SYS_DEBUG_PRINT macro definitions remove the
17798  messages and message function calls. To access and utilize the messages,
17799  define the SYS_DEBUG_USE_CONSOLE macro or override the definitions of the
17800  individual macros.
17801 */
17802 
17803 void
17804  SYS_DEBUG_Print (
17805  const char * format ,
17806  ... ) ;
17807 // *****************************************************************************
17808 /* Function:
17809  void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level);
17810  Summary:
17811  Sets the global system error reporting level.
17812  Description:
17813  This function sets the global system error reporting level.
17814 
17815  Precondition:
17816  SYS_DEBUG_Initialize must have returned a valid object handle.
17817  Parameters:
17818  level - The desired system error level.
17819  Returns:
17820  None.
17821  Example:
17822  <code>
17823  SYS_DEBUG_ErrorLevelSet(SYS_ERROR_WARNING);
17824  </code>
17825  Remarks:
17826  None.
17827 */
17828 
17829 void
17831  SYS_ERROR_LEVEL level ) ;
17832 // *****************************************************************************
17833 /* Function:
17834  SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void);
17835  Summary:
17836  Returns the global system Error reporting level.
17837  Description:
17838  This function returns the global System Error reporting level.
17839 
17840  Precondition:
17841  SYS_DEBUG_Initialize must have returned a valid object handle.
17842  Parameters:
17843  None.
17844  Returns:
17845  The global System Error Level.
17846  Example:
17847  <code>
17848  SYS_ERROR_LEVEL level;
17849 
17850  level = SYS_DEBUG_ErrorLevelGet();
17851  </code>
17852  Remarks:
17853  None.
17854 */
17855 
17857  SYS_DEBUG_ErrorLevelGet ( void ) ;
17858 // *****************************************************************************
17859 // *****************************************************************************
17860 // Section: SYS DEBUG Macros
17861 // *****************************************************************************
17862 // *****************************************************************************
17863 // *****************************************************************************
17864 /* Macro:
17865  _SYS_DEBUG_MESSAGE( SYS_ERROR_LEVEL level, const char* message )
17866  Summary:
17867  Prints a debug message if the specified level is at or below the global
17868  system error level.
17869  Description:
17870  This macro prints a debug message if the specified level is at or below the
17871  global error level. It can be used to implement the SYS_DEBUG_MESSAGE macro.
17872  Precondition:
17873  SYS_DEBUG_Initialize must have returned a valid object handle.
17874  Parameters:
17875  level - The current error level threshold for displaying the message.
17876  message - Pointer to a buffer containing the message to be displayed.
17877  Returns:
17878  None.
17879  Example:
17880  <code>
17881  // In system_config.h
17882 #define SYS_DEBUG_MESSAGE(level,message) _SYS_DEBUG_MESSAGE(level,message)
17883 
17884  // In library source (.c) code.
17885  SYS_DEBUG_MESSAGE(SYS_ERROR_WARNING, "My debug warning message\n\r");
17886  </code>
17887  Remarks:
17888  Do not call this macro directly. Call the SYS_DEBUG_MESSAGE macro instead.
17889 
17890  The default SYS_DEBUG_MESSAGE macro definition removes the message and
17891  function call from the source code. To access and utilize the message,
17892  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
17893  SYS_DEBUG_MESSAGE macro.
17894 */
17895 #define _SYS_DEBUG_MESSAGE( level , message ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Message ( message ) ; } while ( 0 )
17896 // *****************************************************************************
17897 /* Macro:
17898  _SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
17899  Summary:
17900  Formats and prints a debug message if the specified level is at or below the
17901  global system error level.
17902  Description:
17903  This function formats and prints a debug message if the specified level is
17904  at or below the global system error level. It can be used to implement the
17905  SYS_DEBUG_PRINT macro.
17906  Precondition:
17907  SYS_DEBUG_Initialize must have returned a valid object handle.
17908  Parameters:
17909  level - The current error level threshold for displaying the message.
17910  format - Pointer to a buffer containing the format string for
17911  the message to be displayed.
17912  ... - Zero or more optional parameters to be formated as
17913  defined by the format string.
17914  Returns:
17915  None.
17916  Example:
17917  <code>
17918  // In system_config.h
17919 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
17920 
17921  // In source code
17922  int result;
17923 
17924  result = SomeOperation();
17925  if (result > MAX_VALUE)
17926  {
17927  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
17928  // Take appropriate action
17929  }
17930  </code>
17931  Remarks:
17932  Do not call this macro directly. Call the SYS_DEBUG_PRINT macro instead.
17933 
17934  The default SYS_DEBUG_PRINT macro definition removes the message and
17935  function call from the source code. To access and utilize the message,
17936  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
17937  SYS_DEBUG_PRINT macro.
17938 */
17939 #define _SYS_DEBUG_PRINT( level , format ,... ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Print ( format , ## __VA_ARGS__ ) ; } while ( 0 )
17940 // DOM-IGNORE-BEGIN
17941 // *****************************************************************************
17942 /* These definitions support the SYS_DEBUG_USE_CONSOLE build-time configuration
17943  option. Defining SYS_DEBUG_USE_CONSOLE in the system configuration
17944  (system_config.h) will map the macros below to the appropriate system
17945  console functions.
17946 */
17947 // DOM-IGNORE-END
17948 // *****************************************************************************
17949 /* Macro:
17950  SYS_MESSAGE( const char* message )
17951  Summary:
17952  Prints a message to the console regardless of the system error level.
17953  Description:
17954  This macro is used to print a message to the console regardless of the
17955  system error level. It can be mapped to any desired implementation.
17956  Precondition:
17957  If mapped to the _SYS_MESSAGE function, then the system debug service must
17958  be initialized and running.
17959  Parameters:
17960  message - Pointer to a buffer containing the message string to be
17961  displayed.
17962  Returns:
17963  None.
17964  Example:
17965  <code>
17966  // In system_config.h:
17967 #define SYS_MESSAGE(message) _SYS_MESSAGE(message)
17968 
17969  // In source (.c) files:
17970  SYS_MESSAGE("My Message\n\r");
17971  </code>
17972  Remarks:
17973  By default, this macro is defined as nothing, effectively removing all code
17974  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
17975  defined in a way that maps calls to it to the desired implementation (see
17976  example, above).
17977 
17978  This macro can be mapped to the system console service (along with other
17979  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
17980  configuration (system_config.h) instead of defining it individually.
17981 */
17982 #define SYS_MESSAGE( message )
17983 // *****************************************************************************
17984 /* Function:
17985  SYS_DEBUG_MESSAGE( const char* message )
17986  Summary:
17987  Prints a debug message if the system error level is defined defined at
17988  or lower than the level specified.
17989  Description:
17990  This function prints a debug message if the system error level is defined at
17991  or lower than the level specified.
17992  Precondition:
17993  SYSTEM_CURRENT_ERROR_LEVEL must be defined as SYS_ERROR_DEBUG.
17994  Parameters:
17995  level - The current error level threshold for displaying the message.
17996  message - Pointer to a buffer containing the message to be displayed.
17997  Returns:
17998  None.
17999  Example:
18000  <code>
18001 #define SYS_DEBUG_MESSAGE _SYS_DEBUG_MESSAGE
18002  SYS_ERROR_LevelSet(SYS_ERROR_DEBUG);
18003  SYS_DEBUG_MESSAGE("System Debug Message \n\r");
18004  </code>
18005  Remarks:
18006  By default, this macro is defined as nothing, effectively removing all code
18007  generated by calls to it. To process SYS_DEBUG_MESSAGE calls, this macro
18008  must be defined in a way that maps calls to it to the desired implementation
18009  (see example, above).
18010 
18011  This macro can be mapped to the system console service (along with other
18012  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18013  configuration (system_config.h) instead of defining it individually.
18014 */
18015 #define SYS_DEBUG_MESSAGE( level , message )
18016 // *****************************************************************************
18017 /* Function:
18018  SYS_PRINT(const char* format, ...);
18019  Summary:
18020  Formats and prints an error message with a variable number of arguments
18021  regardless of the system error level.
18022  Description:
18023  This function formats and prints an error message with a variable number of
18024  if the system error level is defined at or lower than the level specified.
18025  Precondition:
18026  SYSTEM_CURRENT_ERROR_LEVEL must be defined.
18027  Parameters:
18028  format - Pointer to a buffer containing the format string for
18029  the message to be displayed.
18030  ... - Zero or more optional parameters to be formated as
18031  defined by the format string.
18032  Returns:
18033  None.
18034  Example:
18035  <code>
18036  // In system_config.h
18037 #define SYS_PRINT(format, ...) _SYS_DEBUG_PRINT(format, ##__VA_ARG__)
18038 
18039  // In source code
18040  int result;
18041 
18042  result = SomeOperation();
18043  if (result > MAX_VALUE)
18044  {
18045  SYS_PRINT("Result of %d exceeds max value\r\n", result);
18046  // Take appropriate action
18047  }
18048  </code>
18049  Remarks:
18050  The format string and arguments follow the printf convention. This function
18051  is called by the macros SYS_PRINT and SYS_ERROR_PRINT
18052 
18053  By default, this macro is defined as nothing, effectively removing all code
18054  generated by calls to it. To process SYS_PRINT calls, this macro must be
18055  defined in a way that maps calls to it to the desired implementation (see
18056  example, above).
18057 
18058  This macro can be mapped to the system console service (along with other
18059  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18060  configuration (system_config.h) instead of defining it individually.
18061 */
18062 #define SYS_PRINT( fmt ,... )
18063 // *****************************************************************************
18064 /* Macro:
18065  SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
18066  Summary:
18067  Formats and prints an error message if the system error level is defined at
18068  or lower than the level specified.
18069  Description:
18070  This macro formats and prints an error message if the system error level
18071  is defined at or lower than the level specified.o
18072  Precondition:
18073  SYS_DEBUG_Initialize must have returned a valid object handle.
18074  Parameters:
18075  level - The current error level threshold for displaying the message.
18076  format - Pointer to a buffer containing the format string for
18077  the message to be displayed.
18078  ... - Zero or more optional parameters to be formated as
18079  defined by the format string.
18080  Returns:
18081  None.
18082  Example:
18083  <code>
18084  // In system_config.h
18085 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
18086 
18087  // In source code
18088  int result;
18089 
18090  result = SomeOperation();
18091  if (result > MAX_VALUE)
18092  {
18093  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
18094  // Take appropriate action
18095  }
18096  </code>
18097  Remarks:
18098  The format string and arguments follow the printf convention. This function
18099  is called by the macros SYS_PRINT and SYS_DEBUG_PRINT.
18100 
18101  By default, this macro is defined as nothing, effectively removing all code
18102  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
18103  defined in a way that maps calls to it to the desired implementation (see
18104  example, above).
18105 
18106  This macro can be mapped to the system console service (along with other
18107  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18108  configuration (system_config.h) instead of defining it individually.
18109 */
18110 #define SYS_DEBUG_PRINT( level , fmt ,... )
18111 // *****************************************************************************
18112 /* Macro:
18113  SYS_DEBUG_BreakPoint( void )
18114  Summary:
18115  Inserts a software breakpoint instruction when building in Debug mode.
18116  Description:
18117  This macro inserts a software breakpoint instruction when building in Debug
18118  mode.
18119  Precondition:
18120  None.
18121  Parameters:
18122  None.
18123  Returns:
18124  None.
18125  Example:
18126  <code>
18127  if (myDebugTestFailed)
18128  {
18129  SYS_DEBUG_BreakPoint();
18130  }
18131  </code>
18132  Remarks:
18133  Compiles out if not built for debugging.
18134 */
18135 #define SYS_DEBUG_BreakPoint( )
18136 // *****************************************************************************
18137 // *****************************************************************************
18138 // Section: SYS DEBUG Deprecated Macros
18139 // *****************************************************************************
18140 // *****************************************************************************
18141 /* Do not use these macros for new development.
18142 */
18143 //DOM-IGNORE-BEGIN
18144 #define SYS_DEBUG( level , message ) SYS_DEBUG_MESSAGE ( level , message )
18145 #define SYS_ERROR( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18146 #define SYS_ERROR_PRINT( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18147 //DOM-IGNORE-END
18148  // _SYS_DEBUG_H
18149 /*******************************************************************************
18150  End of File
18151 */
18152 #endif /*00 C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h*/
18153 /* CLOSE_FILE Include File */
18154 
18155 // DOM-IGNORE-BEGIN
18156 // DOM-IGNORE-END
18157 // *****************************************************************************
18158 // *****************************************************************************
18159 // Section: Data Type Definitions
18160 // *****************************************************************************
18161 // *****************************************************************************
18162 /* USART FIFO+RX(8+1) size */
18163 #define _DRV_USART_RX_DEPTH 9
18164 // *****************************************************************************
18165 /* USART Static Driver Instance Object
18166  Summary:
18167  Object used to keep any data required for the static USART driver.
18168  Description:
18169  This object is used to keep track of any data that must be maintained to
18170  manage the USART static driver.
18171  Remarks:
18172  None.
18173 */
18174 
18175 typedef
18176  struct
18177  {
18178  /* Client specific error */
18179  DRV_USART_ERROR error ;
18180  } DRV_USART_OBJ ;
18181 // *****************************************************************************
18182 // *****************************************************************************
18183 // Section: Local functions.
18184 // *****************************************************************************
18185 // *****************************************************************************
18186 // DOM-IGNORE-BEGIN
18187 // DOM-IGNORE-END
18188  //#ifndef _DRV_USART_STATIC_LOCAL_H
18189 /*******************************************************************************
18190  End of File
18191 */
18192 
18193 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h*/
18194 /* CLOSE_FILE Include File */
18195 
18196 // DOM-IGNORE-BEGIN
18197 // DOM-IGNORE-END
18198 // *********************************************************************************************
18199 // *********************************************************************************************
18200 // Section: System Interface Headers for the Instance 0 of USART static driver
18201 // *********************************************************************************************
18202 // *********************************************************************************************
18203 
18204 SYS_MODULE_OBJ
18205  DRV_USART0_Initialize ( void ) ;
18206 
18207 void
18208  DRV_USART0_Deinitialize ( void ) ;
18209 
18210 SYS_STATUS
18211  DRV_USART0_Status ( void ) ;
18212 
18213 void
18214  DRV_USART0_TasksTransmit ( void ) ;
18215 
18216 void
18217  DRV_USART0_TasksReceive ( void ) ;
18218 
18219 void
18220  DRV_USART0_TasksError ( void ) ;
18221 // *********************************************************************************************
18222 // *********************************************************************************************
18223 // Section: General Client Interface Headers for the Instance 0 of USART static driver
18224 // *********************************************************************************************
18225 // *********************************************************************************************
18226 
18227 DRV_HANDLE
18228  DRV_USART0_Open (
18229  const SYS_MODULE_INDEX index ,
18230  const DRV_IO_INTENT ioIntent ) ;
18231 
18232 void
18233  DRV_USART0_Close ( void ) ;
18234 
18236  DRV_USART0_ClientStatus ( void ) ;
18237 
18239  DRV_USART0_TransferStatus ( void ) ;
18240 
18242  DRV_USART0_ErrorGet ( void ) ;
18243 // *********************************************************************************************
18244 // *********************************************************************************************
18245 // Section: Byte Model Client Interface Headers for the Instance 0 of USART static driver
18246 // *********************************************************************************************
18247 // *********************************************************************************************
18248 
18249 uint8_t
18250  DRV_USART0_ReadByte ( void ) ;
18251 
18252 void
18254  const uint8_t byte ) ;
18255 
18256 unsigned int
18258 
18259 unsigned int
18261 
18262 bool
18264 
18265 bool
18267 // *********************************************************************************************
18268 // *********************************************************************************************
18269 // Section: Set up Client Interface Headers for the Instance 0 of USART static driver
18270 // *********************************************************************************************
18271 // *********************************************************************************************
18272 
18275  uint32_t baud ) ;
18276 
18279  DRV_USART_LINE_CONTROL lineControlMode ) ;
18280 // DOM-IGNORE-BEGIN
18281 // DOM-IGNORE-END
18282  // #ifndef _DRV_USART_STATIC_H
18283 /*******************************************************************************
18284  End of File
18285 */
18286 
18287 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h*/
18288 /* CLOSE_FILE Include File */
18289 
18290 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h */
18291 /*******************************************************************************
18292  Ports System Service Interface Definition
18293  Company:
18294  Microchip Technology Inc.
18295  File Name:
18296  sys_ports.h
18297  Summary:
18298  Ports System Service interface definitions
18299  Description:
18300  This file contains the interface definition for the Ports system
18301  service. It provides a way to interact with the Ports subsystem to
18302  manage the timing requests supported by the system
18303 *******************************************************************************/
18304 //DOM-IGNORE-BEGIN
18305 /*******************************************************************************
18306 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18307 Microchip licenses to you the right to use, modify, copy and distribute
18308 Software only when embedded on a Microchip microcontroller or digital signal
18309 controller that is integrated into your product or third party product
18310 (pursuant to the sublicense terms in the accompanying license agreement).
18311 You should refer to the license agreement accompanying this Software for
18312 additional information regarding your rights and obligations.
18313 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18314 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18315 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18316 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18317 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18318 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18319 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18320 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18321 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18322 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18323 *******************************************************************************/
18324 //DOM-IGNORE-END
18325 #ifndef _SYS_PORTS_H
18326 #define _SYS_PORTS_H
18327 // *****************************************************************************
18328 // *****************************************************************************
18329 // Section: Included Files
18330 // *****************************************************************************
18331 // *****************************************************************************
18332 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h */
18333 /*******************************************************************************
18334  PORTS System Service Library Interface Definition
18335  Company:
18336  Microchip Technology Inc.
18337  File Name:
18338  sys_ports_definitions.h
18339  Summary:
18340  PORTS System Service data type definitions header.
18341  Description:
18342  This file contains data type definitions header.
18343 *******************************************************************************/
18344 //DOM-IGNORE-BEGIN
18345 /*******************************************************************************
18346 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18347 Microchip licenses to you the right to use, modify, copy and distribute
18348 Software only when embedded on a Microchip microcontroller or digital signal
18349 controller that is integrated into your product or third party product
18350 (pursuant to the sublicense terms in the accompanying license agreement).
18351 You should refer to the license agreement accompanying this Software for
18352 additional information regarding your rights and obligations.
18353 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18354 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18355 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18356 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18357 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18358 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18359 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18360 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18361 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18362 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18363 *******************************************************************************/
18364 //DOM-IGNORE-END
18365 #ifndef _SYS_PORTS_DEFINITIONS_H
18366 #define _SYS_PORTS_DEFINITIONS_H
18367 // *****************************************************************************
18368 // *****************************************************************************
18369 // Section: File includes
18370 // *****************************************************************************
18371 // *****************************************************************************
18372 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
18373 #include "system/common/sys_common.h"
18374 #include "system/common/sys_module.h"
18375 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h */
18376 /*******************************************************************************
18377  Ports Peripheral Library Interface Header
18378  Company:
18379  Microchip Technology Inc.
18380  File Name:
18381  plib_ports.h
18382  Summary:
18383  Ports Peripheral Library Interface header for Ports function definitions.
18384  Description:
18385  This header file contains the function prototypes and definitions of
18386  the data types and constants that make up the interface to the Ports
18387  Peripheral Library for all families of Microchip microcontrollers. The
18388  definitions in this file are common to the Ports peripheral.
18389 *******************************************************************************/
18390 // DOM-IGNORE-BEGIN
18391 /*******************************************************************************
18392 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
18393 Microchip licenses to you the right to use, modify, copy and distribute
18394 Software only when embedded on a Microchip microcontroller or digital signal
18395 controller that is integrated into your product or third party product
18396 (pursuant to the sublicense terms in the accompanying license agreement).
18397 You should refer to the license agreement accompanying this Software for
18398 additional information regarding your rights and obligations.
18399 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18400 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18401 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18402 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18403 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18404 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18405 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18406 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18407 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18408 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18409 *******************************************************************************/
18410 // DOM-IGNORE-END
18411 #ifndef _PLIB_PORTS_H
18412 #define _PLIB_PORTS_H
18413 #include <stdint.h>
18414 #include <stddef.h>
18415 // DOM-IGNORE-BEGIN
18416 // DOM-IGNORE-END
18417 // *****************************************************************************
18418 // *****************************************************************************
18419 // Section: Constants & Data Types
18420 // *****************************************************************************
18421 // *****************************************************************************
18422 // *****************************************************************************
18423 /* Ports data mask definition
18424  Summary:
18425  Data type defining the Ports data mask
18426  Description:
18427  This data type defines the Ports data mask
18428  Remarks:
18429  None.
18430 */
18431 
18432 typedef
18433 uint16_t
18435 // *****************************************************************************
18436 /* Ports data type definition
18437  Summary:
18438  Data type defining the Ports data type.
18439  Description:
18440  This data type defines the Ports data type.
18441  Remarks:
18442  None.
18443 */
18444 
18445 typedef
18446 uint32_t
18448 // *****************************************************************************
18449 // *****************************************************************************
18450 // Section: Included Files (continued at end of file)
18451 // *****************************************************************************
18452 // *****************************************************************************
18453 /* This section lists the other files that are included in this file. However,
18454  please see the end of the file for additional implementation header files
18455  that are also included.
18456 */
18457 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h */
18458 //DOM-IGNORE-BEGIN
18459 /*******************************************************************************
18460 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
18461 Microchip licenses to you the right to use, modify, copy and distribute
18462 Software only when embedded on a Microchip microcontroller or digital signal
18463 controller that is integrated into your product or third party product
18464 (pursuant to the sublicense terms in the accompanying license agreement).
18465 You should refer to the license agreement accompanying this Software for
18466 additional information regarding your rights and obligations.
18467 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
18468 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18469 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18470 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18471 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18472 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18473 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18474 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18475 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18476 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18477  *******************************************************************************/
18478 //DOM-IGNORE-END
18479 #ifndef _PLIB_PORTS_PROCESSOR_H
18480 #define _PLIB_PORTS_PROCESSOR_H
18481 #error "Can't find header"
18482 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h*/
18483 /* CLOSE_FILE Include File */
18484 
18485 // *****************************************************************************
18486 // *****************************************************************************
18487 // Section: Ports Peripheral Library Interface Routines
18488 // *****************************************************************************
18489 // *****************************************************************************
18490 // *****************************************************************************
18491 /* Function:
18492  void PLIB_PORTS_RemapInput( PORTS_MODULE_ID index,
18493  PORTS_REMAP_INPUT_FUNCTION inputFunction,
18494  PORTS_REMAP_INPUT_PIN remapInputPin );
18495  Summary:
18496  Input function remapping.
18497  Description:
18498  This function controls the Input function remapping. It allows user to map
18499  any of the input functionality on any of the remappable input pin.
18500  This function does not perform atomic register access.
18501  Precondition:
18502  IOLOCK bit of configuration register should be clear to allow any remapping.
18503  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18504  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18505  find more information.
18506  Parameters:
18507  index - Identifier for the device instance to be configured
18508  inputFunction - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
18509  remapInputPin - One of the possible values of PORTS_REMAP_INPUT_PIN
18510  Returns:
18511  None.
18512  Example:
18513  <code>
18514 
18515  // System Unlock
18516  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18517  // Unlock PPS registers
18518  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18519  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
18520  PLIB_PORTS_RemapInput(PORTS_ID_0, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
18521  </code>
18522  Remarks:
18523  This feature may not be available on all devices. Please refer to the
18524  specific device data sheet to determine availability or use
18525  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18526  this feature is available.
18527 */
18528 
18529 void
18531  PORTS_MODULE_ID index ,
18532  PORTS_REMAP_INPUT_FUNCTION inputFunction ,
18533  PORTS_REMAP_INPUT_PIN remapInputPin ) ;
18534 // *****************************************************************************
18535 /* Function:
18536  void PLIB_PORTS_RemapOutput( PORTS_MODULE_ID index,
18537  PORTS_REMAP_OUTPUT_FUNCTION outputFunction,
18538  PORTS_REMAP_OUTPUT_PIN remapOutputPin );
18539  Summary:
18540  Output function remapping.
18541  Description:
18542  This function controls the Output function remapping. it allows user to map
18543  any of the output functionality on any of the remappable output pin.
18544  This function does not perform atomic register access.
18545  Precondition:
18546  IOLOCK bit of configuration register should be clear to allow any remapping.
18547  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18548  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18549  find more information.
18550  Parameters:
18551  index - Identifier for the device instance to be configured
18552  outputFunction - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
18553  remapOutputPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
18554  Returns:
18555  None.
18556  Example:
18557  <code>
18558 
18559  // System Unlock
18560  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18561  // Unlock PPS registers
18562  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18563  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
18564  PLIB_PORTS_RemapOutput(PORTS_ID_0, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
18565 
18566  </code>
18567  Remarks:
18568  This feature may not be available on all devices. Please refer to the
18569  specific device data sheet to determine availability or use
18570  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18571  this feature is available.
18572 */
18573 
18574 void
18576  PORTS_MODULE_ID index ,
18577  PORTS_REMAP_OUTPUT_FUNCTION outputFunction ,
18578  PORTS_REMAP_OUTPUT_PIN remapOutputPin ) ;
18579 // *****************************************************************************
18580 /* Function:
18581  void PLIB_PORTS_PinModeSelect( PORTS_MODULE_ID index,
18582  PORTS_ANALOG_PIN pin,
18583  PORTS_PIN_MODE mode );
18584  Summary:
18585  Enables the selected pin as analog or digital.
18586  Description:
18587  This function enables the selected pin as analog or digital.
18588  This function does not perform atomic register access.
18589  Precondition:
18590  None.
18591  Parameters:
18592  index - Identifier for the device instance to be configured
18593  pin - Possible values of PORTS_ANALOG_PIN
18594  mode - Possible values of PORTS_PIN_MODE
18595  Returns:
18596  None.
18597  Example:
18598  <code>
18599 
18600  // Make AN0 pin as Analog
18601  PLIB_PORTS_PinModeSelect(PORTS_ID_0, PORTS_ANALOG_PIN_0, PORTS_PIN_MODE_ANALOG);
18602 
18603  </code>
18604  Remarks:
18605  This feature may not be available on all devices. Please refer to the
18606  specific device data sheet to determine availability or use
18607  PLIB_PORTS_ExistsPinMode in your application to determine whether
18608  this feature is available.
18609 */
18610 
18611 void
18613  PORTS_MODULE_ID index ,
18614  PORTS_ANALOG_PIN pin ,
18615  PORTS_PIN_MODE mode ) ;
18616 // *****************************************************************************
18617 /* Function:
18618  void PLIB_PORTS_PinModePerPortSelect( PORTS_MODULE_ID index,
18619  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos,
18620  PORTS_PIN_MODE mode );
18621  Summary:
18622  Enables the selected port pin as analog or digital.
18623  Description:
18624  This function enables the selected port pin as analog or digital.
18625  This function does not perform atomic register access.
18626  Precondition:
18627  None.
18628  Parameters:
18629  index - Identifier for the device instance to be configured
18630  channel - Port pin channel
18631  bitPos - Position in the PORT pins
18632  mode - Possible values of PORTS_PIN_MODE
18633  Returns:
18634  None.
18635  Example:
18636  <code>
18637 
18638  // Make RC5 pin Analog
18639  PLIB_PORTS_PinModePerPortSelect(PORTS_ID_0, PORT_CHANNEL_C,
18640  PORTS_BIT_POS_5, PORTS_PIN_MODE_ANALOG);
18641 
18642  </code>
18643  Remarks:
18644  This function is only available in devices with PPS. For Non-PPS devices, use the
18645  PLIB_PORTS_PinModeSelect function.
18646 
18647  This feature may not be available on all devices. Please refer to the
18648  specific device data sheet to determine availability or use
18649  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
18650  this feature is available.
18651 */
18652 
18653 void
18655  PORTS_MODULE_ID index ,
18656  PORTS_CHANNEL channel ,
18657  PORTS_BIT_POS bitPos ,
18658  PORTS_PIN_MODE mode ) ;
18659 // *****************************************************************************
18660 /* Function:
18661  void PLIB_PORTS_ChangeNoticePullDownPerPortEnable( PORTS_MODULE_ID index,
18662  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18663  Summary:
18664  Enables the pull-down for selected Change Notice pins.
18665  Description:
18666  This function enables the pull-down for selected Change Notice pins.
18667  This function does not perform atomic register access.
18668  Precondition:
18669  None.
18670  Parameters:
18671  index - Identifier for the device instance to be configured
18672  channel - Port pin channel
18673  bitPos - Position in the PORT pins
18674  Returns:
18675  None.
18676  Example:
18677  <code>
18678 
18679  // Enable pull-down for RC5 pin
18680  PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18681  PORTS_BIT_POS_5);
18682 
18683  </code>
18684  Remarks:
18685  This feature may not be available on all devices. Please refer to the
18686  specific device data sheet to determine availability or use
18687  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
18688  determine whether this feature is available.
18689 */
18690 
18691 void
18693  PORTS_MODULE_ID index ,
18694  PORTS_CHANNEL channel ,
18695  PORTS_BIT_POS bitPos ) ;
18696 // *****************************************************************************
18697 /* Function:
18698  void PLIB_PORTS_ChangeNoticePullDownPerPortDisable( PORTS_MODULE_ID index,
18699  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18700  Summary:
18701  Disables the pull-down for selected Change Notice pins.
18702  Description:
18703  This function disables the pull-down for selected Change Notice pins.
18704  This function does not perform atomic register access.
18705  Precondition:
18706  None.
18707  Parameters:
18708  index - Identifier for the device instance to be configured
18709  channel - Port pin channel
18710  bitPos - Position in the PORT pins
18711  Returns:
18712  None.
18713  Example:
18714  <code>
18715 
18716  // Disable pull-down for RC5 pin
18717  PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18718  PORTS_BIT_POS_5);
18719  </code>
18720  Remarks:
18721  This feature may not be available on all devices. Please refer to the
18722  specific device data sheet to determine availability or use
18723  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
18724  determine whether this feature is available.
18725 */
18726 
18727 void
18729  PORTS_MODULE_ID index ,
18730  PORTS_CHANNEL channel ,
18731  PORTS_BIT_POS bitPos ) ;
18732 // *****************************************************************************
18733 /* Function:
18734  void PLIB_PORTS_ChangeNoticePullUpPerPortEnable ( PORTS_MODULE_ID index,
18735  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18736  Summary:
18737  Enables the pull-up for selected Change Notice pins.
18738  Description:
18739  This function enables the pull-up for selected Change Notice pins.
18740  This function does not perform atomic register access.
18741  Precondition:
18742  None.
18743  Parameters:
18744  index - Identifier for the device instance to be configured
18745  channel - Port pin channel
18746  bitPos - Position in the PORT pins
18747  Returns:
18748  None.
18749  Example:
18750  <code>
18751 
18752  // Enable pull-up for RC5 pin
18753  PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18754  PORTS_BIT_POS_5);
18755  </code>
18756  Remarks:
18757  This function is only available in devices with PPS. For Non-PPS devices, use the
18758  PLIB_PORTS_ChangeNoticePullUpEnable function.
18759 
18760  This feature may not be available on all devices. Please refer to the
18761  specific device data sheet to determine availability or use
18762  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
18763  determine whether this feature is available.
18764 */
18765 
18766 void
18768  PORTS_MODULE_ID index ,
18769  PORTS_CHANNEL channel ,
18770  PORTS_BIT_POS bitPos ) ;
18771 // *****************************************************************************
18772 /* Function:
18773  void PLIB_PORTS_ChangeNoticePullUpPerPortDisable( PORTS_MODULE_ID index,
18774  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
18775  Summary:
18776  Disables weak pull-up for the selected pin.
18777  Description:
18778  This function disables weak pull-up for the selected port pin.
18779  This function does not perform atomic register access.
18780  Precondition:
18781  None.
18782  Parameters:
18783  index - Identifier for the device instance to be configured
18784  channel - Port pin channel
18785  bitPos - Position in the PORT pins
18786  Returns:
18787  None.
18788  Example:
18789  <code>
18790 
18791  // Disable pull-up for RC5 pin
18792  PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18793  PORTS_BIT_POS_5);
18794 
18795  </code>
18796  Remarks:
18797  This function is only available in devices with PPS. For Non-PPS devices, use the
18798  PLIB_PORTS_ChangeNoticePullUpDisable function.
18799 
18800  Pull-ups on change notification pins should always be disabled when the
18801  port pin is configured as a digital output.
18802 
18803  This feature may not be available on all devices. Please refer to the
18804  specific device data sheet to determine availability or use
18805  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
18806  determine whether this feature is available.
18807 */
18808 
18809 void
18811  PORTS_MODULE_ID index ,
18812  PORTS_CHANNEL channel ,
18813  PORTS_BIT_POS bitPos ) ;
18814 // *****************************************************************************
18815 /* Function:
18816  void PLIB_PORTS_PinChangeNoticePerPortEnable ( PORTS_MODULE_ID index,
18817  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18818  Summary:
18819  Enables CN interrupt for the selected pin.
18820  Description:
18821  This function enables Change Notice interrupt for the selected port pin.
18822  This function does not perform atomic register access.
18823 
18824  Precondition:
18825  None.
18826  Parameters:
18827  index - Identifier for the device instance to be configured
18828  channel - Port pin channel
18829  bitPos - Position in the PORT pins
18830  Returns:
18831  None.
18832  Example:
18833  <code>
18834 
18835  // Enable CN interrupt for RC5 pin
18836  PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18837  PORTS_BIT_POS_5);
18838 
18839  </code>
18840  Remarks:
18841  This function is only available in devices with PPS. For Non-PPS devices, use the
18842  PLIB_PORTS_PinChangeNoticeEnable function.
18843 
18844  This feature may not be available on all devices. Please refer to the
18845  specific device data sheet to determine availability or use
18846  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
18847  determine whether this feature is available.
18848 */
18849 
18850 void
18852  PORTS_MODULE_ID index ,
18853  PORTS_CHANNEL channel ,
18854  PORTS_BIT_POS bitPos ) ;
18855 // *****************************************************************************
18856 /* Function:
18857  void PLIB_PORTS_PinChangeNoticePerPortDisable( PORTS_MODULE_ID index,
18858  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18859  Summary:
18860  Disables CN interrupt for the selected pin.
18861  Description:
18862  This function disables Change Notice interrupt for the selected port pin.
18863  This function does not perform atomic register access.
18864  Precondition:
18865  None.
18866  Parameters:
18867  index - Identifier for the device instance to be configured
18868  channel - Port pin channel
18869  bitPos - Position in the PORT pins
18870  Returns:
18871  None.
18872  Example:
18873  <code>
18874 
18875  // Disable CN interrupt for RC5 pin
18876  PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18877  PORTS_BIT_POS_5);
18878 
18879  </code>
18880  Remarks:
18881  This function is only available in devices with PPS. For Non-PPS devices, use the
18882  PLIB_PORTS_PinChangeNoticeDisable function.
18883 
18884  This feature may not be available on all devices. Please refer to the
18885  specific device data sheet to determine availability or use
18886  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
18887  determine whether this feature is available.
18888 */
18889 
18890 void
18892  PORTS_MODULE_ID index ,
18893  PORTS_CHANNEL channel ,
18894  PORTS_BIT_POS bitPos ) ;
18895 // *****************************************************************************
18896 /* Function:
18897  void PLIB_PORTS_ChangeNoticePerPortTurnOn ( PORTS_MODULE_ID index,
18898  PORTS_CHANNEL channel );
18899  Summary:
18900  Enables the change notification for selected port.
18901  Description:
18902  This function enables the change notification for selected port.
18903  This function does not perform atomic register access.
18904  Precondition:
18905  None.
18906  Parameters:
18907  index - Identifier for the device instance to be configured
18908  channel - Port pin channel
18909  Returns:
18910  None.
18911  Example:
18912  <code>
18913  // Enable Change notification for Port C
18914  PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_ID_0, PORT_CHANNEL_C);
18915 
18916  </code>
18917  Remarks:
18918  This function is only available in devices with PPS. For Non-PPS devices, use the
18919  PLIB_PORTS_ChangeNoticeEnable function.
18920 
18921  This feature may not be available on all devices. Please refer to the
18922  specific device data sheet to determine availability or use
18923  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
18924  whether this feature is available.
18925 */
18926 
18927 void
18929  PORTS_MODULE_ID index ,
18930  PORTS_CHANNEL channel ) ;
18931 // *****************************************************************************
18932 /* Function:
18933  void PLIB_PORTS_ChangeNoticePerPortTurnOff( PORTS_MODULE_ID index,
18934  PORTS_CHANNEL channel );
18935  Summary:
18936  Disables the change notification for selected port.
18937  Description:
18938  This function disables the change notification for selected port.
18939  This function does not perform atomic register access.
18940  Precondition:
18941  None.
18942  Parameters:
18943  index - Identifier for the device instance to be configured
18944  channel - Port pin channel
18945  Returns:
18946  None.
18947  Example:
18948  <code>
18949  // Disable Change notification for Port C
18950  PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_ID_0, PORT_CHANNEL_C);
18951 
18952  </code>
18953  Remarks:
18954  This function is only available in devices with PPS. For Non-PPS devices, use the
18955  PLIB_PORTS_ChangeNoticeDisable function.
18956 
18957  This feature may not be available on all devices. Please refer to the
18958  specific device data sheet to determine availability or use
18959  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
18960  whether this feature is available.
18961 */
18962 
18963 void
18965  PORTS_MODULE_ID index ,
18966  PORTS_CHANNEL channel ) ;
18967 // *****************************************************************************
18968 /* Function:
18969  void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable ( PORTS_MODULE_ID index,
18970  PORTS_CHANNEL channel );
18971  Summary:
18972  Allows CN to be working in Idle mode for selected channel.
18973  Description:
18974  This function makes sure that change notification feature keeps working in
18975  Idle mode for the selected channel.
18976  This function does not perform atomic register access.
18977  Precondition:
18978  None.
18979  Parameters:
18980  index - Identifier for the device instance to be configured
18981  channel - Port pin channel
18982  Returns:
18983  None.
18984  Example:
18985  <code>
18986 
18987  // Change notification continues working in Idle mode for Port C
18988  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C);
18989 
18990  </code>
18991  Remarks:
18992  This function is only available in devices with PPS. For Non-PPS devices, use the
18993  PLIB_PORTS_ChangeNoticeInIdleEnable function.
18994 
18995  This feature may not be available on all devices. Please refer to the
18996  specific device data sheet to determine availability or use
18997  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
18998  whether this feature is available.
18999 */
19000 
19001 void
19003  PORTS_MODULE_ID index ,
19004  PORTS_CHANNEL channel ) ;
19005 // *****************************************************************************
19006 /* Function:
19007  void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable( PORTS_MODULE_ID index,
19008  PORTS_CHANNEL channel );
19009  Summary:
19010  Change Notification halts in Idle mode for selected channel.
19011  Description:
19012  This function makes sure that change notification feature halts in
19013  Idle mode for the selected channel.
19014  This function does not perform atomic register access.
19015  Precondition:
19016  None.
19017  Parameters:
19018  index - Identifier for the device instance to be configured
19019  channel - Port pin channel
19020  Returns:
19021  None.
19022  Example:
19023  <code>
19024 
19025  // Change notification halts in Idle mode for Port C
19026  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C);
19027 
19028  </code>
19029  Remarks:
19030  This function is only available in devices with PPS. For Non-PPS devices, use the
19031  PLIB_PORTS_ChangeNoticeInIdleDisable function.
19032 
19033  This feature may not be available on all devices. Please refer to the
19034  specific device data sheet to determine availability or use
19035  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
19036  whether this feature is available.
19037 */
19038 
19039 void
19041  PORTS_MODULE_ID index ,
19042  PORTS_CHANNEL channel ) ;
19043 // *****************************************************************************
19044 /* Function:
19045  bool PLIB_PORTS_ChangeNoticePerPortHasOccurred ( PORTS_MODULE_ID index,
19046  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
19047  Summary:
19048  checks the status of change on the pin
19049  Description:
19050  This function checks if the change has occurred on the given pin or not.
19051  This function does not perform atomic register access.
19052  Precondition:
19053  None.
19054  Parameters:
19055  index - Identifier for the device instance to be configured
19056  channel - Port pin channel
19057  bitPos - Position in the PORT pins
19058  Returns:
19059  None.
19060  Example:
19061  <code>
19062 
19063  if(PLIB_PORTS_ChangeNoticePerPortHasOccurred( PORTS_ID_0,
19064  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
19065  {
19066  //do something
19067  }
19068 
19069  </code>
19070  Remarks:
19071  This feature may not be available on all devices. Please refer to the
19072  specific device data sheet to determine availability or use
19073  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
19074  whether this feature is available.
19075 */
19076 
19077 bool
19079  PORTS_MODULE_ID index ,
19080  PORTS_CHANNEL channel ,
19081  PORTS_BIT_POS bitPos ) ;
19082 // *****************************************************************************
19083 /* Function:
19084  bool PLIB_PORTS_PinGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19085  PORTS_BIT_POS bitPos )
19086  Summary:
19087  Reads/Gets data from the selected digital pin.
19088  Description:
19089  This function reads/gets data from the selected digital PORT i/o pin.
19090  This function should be used to read the live data at the pin.
19091  This function does not perform atomic register access.
19092 
19093  Precondition:
19094  None.
19095  Parameters:
19096  index - Identifier for the device instance to be configured
19097  channel - Identifier for the Ports channel A, B, C, etc.
19098  bitPos - Possible values of PORTS_BIT_POS
19099  Returns:
19100  Port pin read data.
19101  Example:
19102  <code>
19103  // read port pin RC4
19104  bool bitStatus = PLIB_PORTS_PinGet(PORTS_ID_0, PORT_CHANNEL_C,
19105  PORTS_BIT_POS_4);
19106  </code>
19107  Remarks:
19108  For reading the Latched data, PLIB_PORTS_PinGetLatched function should be used.
19109 
19110  This feature may not be available on all devices. Please refer to the
19111  specific device data sheet to determine availability or use
19112  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19113  this feature is available.
19114 */
19115 
19116 bool
19118  PORTS_MODULE_ID index ,
19119  PORTS_CHANNEL channel ,
19120  PORTS_BIT_POS bitPos ) ;
19121 // *****************************************************************************
19122 /* Function:
19123  bool PLIB_PORTS_PinGetLatched( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19124  PORTS_BIT_POS bitPos )
19125  Summary:
19126  Reads/Gets data from the selected latch.
19127  Description:
19128  This function reads/gets data from the selected PORTx Data Latch, not from
19129  the port I/O pins.
19130  This function does not perform atomic register access.
19131 
19132  Precondition:
19133  None.
19134  Parameters:
19135  index - Identifier for the device instance to be configured
19136  channel - Identifier for the Ports channel A, B, C, etc.
19137  bitPos - Possible values of PORTS_BIT_POS
19138  Returns:
19139  Latch read data.
19140  Example:
19141  <code>
19142  // read latch RC4
19143  bool bitStatus = PLIB_PORTS_PinGetLatched(PORTS_ID_0, PORT_CHANNEL_C,
19144  PORTS_BIT_POS_4);
19145  </code>
19146  Remarks:
19147  For reading the Live data from the i/o pin, PLIB_PORTS_PinGet function
19148  should be used.
19149 
19150  This feature may not be available on all devices. Please refer to the
19151  specific device data sheet to determine availability or use
19152  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19153  this feature is available.
19154 */
19155 
19156 bool
19158  PORTS_MODULE_ID index ,
19159  PORTS_CHANNEL channel ,
19160  PORTS_BIT_POS bitPos ) ;
19161 // *****************************************************************************
19162 /* Function:
19163  void PLIB_PORTS_PinWrite( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19164  PORTS_BIT_POS bitPos,
19165  bool value )
19166  Summary:
19167  Writes the selected digital pin/latch.
19168  Description:
19169  This function writes to the selected digital pin/latch.
19170  This function does not perform atomic register access.
19171  Precondition:
19172  None.
19173  Parameters:
19174  index - Identifier for the device instance to be configured
19175  channel - Identifier for the Ports channel A, B, C, etc.
19176  bitPos - Possible values of PORTS_BIT_POS
19177  value - Value to be written to the specific pin/latch
19178  true - sets the bit, false - clears the bit
19179  Returns:
19180  None.
19181  Example:
19182  <code>
19183 
19184  // write 'one' in port RC4
19185  PLIB_PORTS_PinWrite(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4, 1);
19186 
19187  </code>
19188  Remarks:
19189  This feature may not be available on all devices. Please refer to the
19190  specific device data sheet to determine availability or use
19191  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19192  this feature is available.
19193 */
19194 
19195 void
19197  PORTS_MODULE_ID index ,
19198  PORTS_CHANNEL channel ,
19199  PORTS_BIT_POS bitPos ,
19200  bool value ) ;
19201 // *****************************************************************************
19202 /* Function:
19203  void PLIB_PORTS_PinSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19204  PORTS_BIT_POS bitPos )
19205  Summary:
19206  Sets the selected digital pin/latch.
19207  Description:
19208  This function sets the selected digital pin/latch.
19209  This function does not perform atomic register access.
19210  Precondition:
19211  None.
19212  Parameters:
19213  index - Identifier for the device instance to be configured
19214  channel - Identifier for the Ports channel A, B, C, etc.
19215  bitPos - Possible values of PORTS_BIT_POS
19216  Returns:
19217  None.
19218  Example:
19219  <code>
19220 
19221  // Sets port pin RC4
19222  PLIB_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19223 
19224  </code>
19225  Remarks:
19226  This feature may not be available on all devices. Please refer to the
19227  specific device data sheet to determine availability or use
19228  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19229  this feature is available.
19230 */
19231 
19232 void
19234  PORTS_MODULE_ID index ,
19235  PORTS_CHANNEL channel ,
19236  PORTS_BIT_POS bitPos ) ;
19237 // *****************************************************************************
19238 /* Function:
19239  void PLIB_PORTS_PinClear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19240  PORTS_BIT_POS bitPos )
19241  Summary:
19242  Clears the selected digital pin/latch.
19243  Description:
19244  This function clears the selected digital pin/latch.
19245  This function does not perform atomic register access.
19246  Precondition:
19247  None.
19248  Parameters:
19249  index - Identifier for the device instance to be configured
19250  channel - Identifier for the Ports channel A, B, C, etc.
19251  bitPos - Possible values of PORTS_BIT_POS
19252  Returns:
19253  None.
19254  Example:
19255  <code>
19256 
19257  // Clears port pin RC4
19258  PLIB_PORTS_PinClear(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19259 
19260  </code>
19261  Remarks:
19262  This feature may not be available on all devices. Please refer to the
19263  specific device data sheet to determine availability or use
19264  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19265  this feature is available.
19266 */
19267 
19268 void
19270  PORTS_MODULE_ID index ,
19271  PORTS_CHANNEL channel ,
19272  PORTS_BIT_POS bitPos ) ;
19273 // *****************************************************************************
19274 /* Function:
19275  void PLIB_PORTS_PinToggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19276  PORTS_BIT_POS bitPos )
19277  Summary:
19278  Toggles the selected digital pin/latch.
19279  Description:
19280  This function toggles the selected digital pin/latch.
19281  This function does not perform atomic register access.
19282  Precondition:
19283  None.
19284  Parameters:
19285  index - Identifier for the device instance to be configured
19286  channel - Identifier for the Ports channel A, B, C, etc.
19287  bitPos - Possible values of PORTS_BIT_POS
19288  Returns:
19289  None.
19290  Example:
19291  <code>
19292 
19293  // Toggles port pin RC4
19294  PLIB_PORTS_PinToggle(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19295 
19296  </code>
19297  Remarks:
19298  This feature may not be available on all devices. Please refer to the
19299  specific device data sheet to determine availability or use
19300  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19301  this feature is available.
19302 */
19303 
19304 void
19306  PORTS_MODULE_ID index ,
19307  PORTS_CHANNEL channel ,
19308  PORTS_BIT_POS bitPos ) ;
19309 // *****************************************************************************
19310 /* Function:
19311  void PLIB_PORTS_PinDirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19312  PORTS_BIT_POS bitPos )
19313  Summary:
19314  Makes the selected pin direction input
19315  Description:
19316  This function makes the selected pin direction as input
19317  This function does not perform atomic register access.
19318  Precondition:
19319  None.
19320  Parameters:
19321  index - Identifier for the device instance to be configured
19322  channel - Identifier for the Ports channel A, B, C, etc.
19323  bitPos - Possible values of PORTS_BIT_POS direction that has to
19324  be made input
19325  Returns:
19326  None.
19327  Example:
19328  <code>
19329 
19330  // make pin RC4 as input
19331  PLIB_PORTS_PinDirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19332 
19333  </code>
19334  Remarks:
19335  This feature may not be available on all devices. Please refer to the
19336  specific device data sheet to determine availability or use
19337  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19338  this feature is available.
19339 */
19340 
19341 void
19343  PORTS_MODULE_ID index ,
19344  PORTS_CHANNEL channel ,
19345  PORTS_BIT_POS bitPos ) ;
19346 // *****************************************************************************
19347 /* Function:
19348  void PLIB_PORTS_PinDirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19349  PORTS_BIT_POS bitPos )
19350  Summary:
19351  Makes the selected pin direction output
19352  Description:
19353  This function makes the selected pin direction as output
19354  This function does not perform atomic register access.
19355  Precondition:
19356  None.
19357  Parameters:
19358  index - Identifier for the device instance to be configured
19359  channel - Identifier for the Ports channel A, B, C, etc.
19360  bitPos - Possible values of PORTS_BIT_POS direction that has to
19361  be made output
19362  Returns:
19363  None.
19364  Example:
19365  <code>
19366 
19367  // make pin RC4 as output
19368  PLIB_PORTS_PinDirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19369 
19370  </code>
19371  Remarks:
19372  This feature may not be available on all devices. Please refer to the
19373  specific device data sheet to determine availability or use
19374  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19375  this feature is available.
19376 */
19377 
19378 void
19380  PORTS_MODULE_ID index ,
19381  PORTS_CHANNEL channel ,
19382  PORTS_BIT_POS bitPos ) ;
19383 // *****************************************************************************
19384 /* Function:
19385  void PLIB_PORTS_PinOpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19386  PORTS_BIT_POS bitPos )
19387  Summary:
19388  Enables the open drain functionality for the selected pin.
19389  Description:
19390  This function enables the open drain functionality for the selected pin.
19391  This function does not perform atomic register access.
19392  Precondition:
19393  None.
19394  Parameters:
19395  index - Identifier for the device instance to be configured
19396  channel - Identifier for the Ports channel A, B, C, etc.
19397  bitPos - Possible values of PORTS_BIT_POS
19398  Returns:
19399  None.
19400  Example:
19401  <code>
19402 
19403  // Enable open drain for pin RC4
19404  PLIB_PORTS_PinOpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19405 
19406  </code>
19407  Remarks:
19408  This feature may not be available on all devices. Please refer to the
19409  specific device data sheet to determine availability or use
19410  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19411  this feature is available.
19412 */
19413 
19414 void
19416  PORTS_MODULE_ID index ,
19417  PORTS_CHANNEL channel ,
19418  PORTS_BIT_POS bitPos ) ;
19419 // *****************************************************************************
19420 /* Function:
19421  void PLIB_PORTS_PinOpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19422  PORTS_BIT_POS bitPos )
19423  Summary:
19424  Disables the open drain functionality for the selected pin.
19425  Description:
19426  This function disables the open drain functionality for the selected pin.
19427  This function does not perform atomic register access.
19428  Precondition:
19429  None.
19430  Parameters:
19431  index - Identifier for the device instance to be configured
19432  channel - Identifier for the Ports channel A, B, C, etc.
19433  bitPos - One of the possible values of PORTS_BIT_POS.
19434  Returns:
19435  None.
19436  Example:
19437  <code>
19438 
19439  // Disable open drain for pin RC4
19440  PLIB_PORTS_PinOpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19441 
19442  </code>
19443  Remarks:
19444  This feature may not be available on all devices. Please refer to the
19445  specific device data sheet to determine availability or use
19446  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19447  this feature is available.
19448 */
19449 
19450 void
19452  PORTS_MODULE_ID index ,
19453  PORTS_CHANNEL channel ,
19454  PORTS_BIT_POS bitPos ) ;
19455 // *****************************************************************************
19456 /* Function:
19457  PORTS_DATA_TYPE PLIB_PORTS_ReadLatched
19458  (
19459  PORTS_MODULE_ID index,
19460  PORTS_CHANNEL channel
19461  )
19462  Summary:
19463  Reads and returns data from the selected Latch.
19464  Description:
19465  This function reads and returns the data from the selected Latch.
19466  This function does not perform atomic register access.
19467 
19468  Precondition:
19469  None.
19470  Parameters:
19471  index - Identifier for the device instance to be configured
19472  channel - Identifier for the Ports channel A, B, C, etc.
19473  Returns:
19474  Latch read data.
19475  Example:
19476  <code>
19477  // Read latch C
19478  PORTS_DATA_TYPE bitStatus = PLIB_PORTS_ReadLatched(PORTS_ID_0, PORT_CHANNEL_C);
19479 
19480  </code>
19481  Remarks:
19482  For reading the Live data, PLIB_PORTS_Read function should be used.
19483 
19484  This feature may not be available on all devices. Please refer to the
19485  specific device data sheet to determine availability or use
19486  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19487  this feature is available.
19488 */
19489 
19492  PORTS_MODULE_ID index ,
19493  PORTS_CHANNEL channel ) ;
19494 // *****************************************************************************
19495 /* Function:
19496  PORTS_DATA_TYPE PLIB_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
19497  Summary:
19498  Reads the selected digital port.
19499  Description:
19500  This function reads from the selected digital port.
19501  This function does not perform atomic register access.
19502  Precondition:
19503  None.
19504  Parameters:
19505  index - Identifier for the device instance to be configured
19506  channel - Identifier for the Ports channel A, B, C, etc.
19507  Returns:
19508  data on a port with width PORTS_DATA_TYPE
19509  Example:
19510  <code>
19511 
19512  // Read PORT C
19513  PORTS_DATA_TYPE readData = PLIB_PORTS_Read(PORTS_ID_0, PORT_CHANNEL_C);
19514 
19515  </code>
19516  Remarks:
19517  For reading the Latched data, PLIB_PORTS_ReadLatched function should be used.
19518 
19519  This feature may not be available on all devices. Please refer to the
19520  specific device data sheet to determine availability or use
19521  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19522  this feature is available.
19523 */
19524 
19526  PLIB_PORTS_Read (
19527  PORTS_MODULE_ID index ,
19528  PORTS_CHANNEL channel ) ;
19529 // *****************************************************************************
19530 /* Function:
19531  void PLIB_PORTS_Write( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19532  PORTS_DATA_TYPE value )
19533  Summary:
19534  Writes the selected digital port/latch.
19535  Description:
19536  This function writes to the selected digital port/latch.
19537  This function does not perform atomic register access.
19538  Precondition:
19539  None.
19540  Parameters:
19541  index - Identifier for the device instance to be configured
19542  channel - Identifier for the Ports channel A, B, C, etc.
19543  value - Value to be written into a port of width PORTS_DATA_TYPE
19544  Returns:
19545  None.
19546  Example:
19547  <code>
19548 
19549  // Write 0x12 into PORT C
19550  PLIB_PORTS_Write(PORTS_ID_0, PORT_CHANNEL_C, 0x12);
19551 
19552  </code>
19553  Remarks:
19554  This feature may not be available on all devices. Please refer to the
19555  specific device data sheet to determine availability or use
19556  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19557  this feature is available.
19558 */
19559 
19560 void
19562  PORTS_MODULE_ID index ,
19563  PORTS_CHANNEL channel ,
19564  PORTS_DATA_TYPE value ) ;
19565 // *****************************************************************************
19566 /* Function:
19567  void PLIB_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19568  PORTS_DATA_TYPE value,
19569  PORTS_DATA_MASK mask )
19570  Summary:
19571  Sets the selected bits of the port.
19572  Description:
19573  This function performs an 'AND' operation on the value and mask parameters,
19574  and then sets the bits in the port channel that were set by the result of the
19575  'AND' operation.
19576  This function does not perform atomic register access.
19577  Precondition:
19578  None.
19579  Parameters:
19580  index - Identifier for the device instance to be configured
19581  channel - Identifier for the Ports channel A, B, C, etc.
19582  value - Consists of information about which port bit has to be
19583  set and which not
19584  mask - Identifies the bits which could be intended for setting
19585  Returns:
19586  None.
19587  Example:
19588  <code>
19589 
19590  // MY_VALUE - 0x1234
19591  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
19592 
19593  // Set the PORT C bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
19594  PLIB_PORTS_Set(MY_PORTS_INSTANCE, PORT_CHANNEL_C, MY_VALUE, myMask);
19595 
19596  </code>
19597  Remarks:
19598  This feature may not be available on all devices. Please refer to the
19599  specific device data sheet to determine availability or use
19600  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19601  this feature is available.
19602 */
19603 
19604 void
19605  PLIB_PORTS_Set (
19606  PORTS_MODULE_ID index ,
19607  PORTS_CHANNEL channel ,
19608  PORTS_DATA_TYPE value ,
19609  PORTS_DATA_MASK mask ) ;
19610 // *****************************************************************************
19611 /* Function:
19612  void PLIB_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19613  PORTS_DATA_MASK toggleMask )
19614  Summary:
19615  Toggles the selected digital port/latch.
19616  Description:
19617  This function toggles the selected digital port/latch.
19618  This function does not perform atomic register access.
19619  Precondition:
19620  None.
19621  Parameters:
19622  index - Identifier for the device instance to be configured
19623  channel - Identifier for the Ports channel A, B, C, etc.
19624  toggleMask - Identifies the bits to be toggled
19625  Returns:
19626  None.
19627  Example:
19628  <code>
19629 
19630  // Toggles the three least significant Port C bits
19631  PLIB_PORTS_Toggle(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19632 
19633  </code>
19634  Remarks:
19635  This feature may not be available on all devices. Please refer to the
19636  specific device data sheet to determine availability or use
19637  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19638  this feature is available.
19639 */
19640 
19641 void
19643  PORTS_MODULE_ID index ,
19644  PORTS_CHANNEL channel ,
19645  PORTS_DATA_MASK toggleMask ) ;
19646 // *****************************************************************************
19647 /* Function:
19648  void PLIB_PORTS_Clear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19649  PORTS_DATA_MASK clearMask )
19650  Summary:
19651  Clears the selected digital port/latch bits.
19652  Description:
19653  This function clears the selected digital port/latch bits.
19654  This function does not perform atomic register access.
19655  Precondition:
19656  None.
19657  Parameters:
19658  index - Identifier for the device instance to be configured
19659  channel - Identifier for the Ports channel A, B, C, etc.
19660  clearMask - Identifies the bits to be cleared
19661  Returns:
19662  None.
19663  Example:
19664  <code>
19665 
19666  // Clears the three least significant Port C bits
19667  PLIB_PORTS_Clear(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19668 
19669  </code>
19670  Remarks:
19671  This feature may not be available on all devices. Please refer to the
19672  specific device data sheet to determine availability or use
19673  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19674  this feature is available.
19675 */
19676 
19677 void
19679  PORTS_MODULE_ID index ,
19680  PORTS_CHANNEL channel ,
19681  PORTS_DATA_MASK clearMask ) ;
19682 // *****************************************************************************
19683 /* Function:
19684  void PLIB_PORTS_DirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19685  PORTS_DATA_MASK mask )
19686  Summary:
19687  Makes the selected pins direction input.
19688  Description:
19689  This function makes the selected pins direction input.
19690  This function does not perform atomic register access.
19691 
19692  Precondition:
19693  None.
19694  Parameters:
19695  index - Identifier for the device instance to be configured
19696  channel - Identifier for the Ports channel A, B, C, etc.
19697  mask - Identifies the pins direction that has to be made input
19698  Returns:
19699  None.
19700  Example:
19701  <code>
19702 
19703  // Make RC0, RC1 and RC2 pins as Input
19704  PLIB_PORTS_DirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19705 
19706  </code>
19707  Remarks:
19708  This feature may not be available on all devices. Please refer to the
19709  specific device data sheet to determine availability or use
19710  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19711  this feature is available.
19712 */
19713 
19714 void
19716  PORTS_MODULE_ID index ,
19717  PORTS_CHANNEL channel ,
19718  PORTS_DATA_MASK mask ) ;
19719 // *****************************************************************************
19720 /* Function:
19721  void PLIB_PORTS_DirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19722  PORTS_DATA_MASK mask )
19723  Summary:
19724  Makes the selected pins direction output.
19725  Description:
19726  This function makes the selected pins direction output.
19727  This function does not perform atomic register access.
19728  Precondition:
19729  None.
19730  Parameters:
19731  index - Identifier for the device instance to be configured
19732  channel - Identifier for the Ports channel A, B, C, etc.
19733  mask - Identifies the pins direction that has to be made output
19734  Returns:
19735  None.
19736  Example:
19737  <code>
19738 
19739  // Make RC0, RC1 and RC2 pins as Output
19740  PLIB_PORTS_DirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19741 
19742  </code>
19743  Remarks:
19744  This feature may not be available on all devices. Please refer to the
19745  specific device data sheet to determine availability or use
19746  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19747  this feature is available.
19748 */
19749 
19750 void
19752  PORTS_MODULE_ID index ,
19753  PORTS_CHANNEL channel ,
19754  PORTS_DATA_MASK mask ) ;
19755 // *****************************************************************************
19756 /* Function:
19757  PORTS_DATA_MASK PLIB_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
19758  Summary:
19759  Reads the direction of the selected digital port.
19760  Description:
19761  This function reads the direction of the selected digital port.
19762  This function does not perform atomic register access.
19763  Precondition:
19764  None.
19765  Parameters:
19766  index - Identifier for the device instance to be configured
19767  channel - Identifier for the Ports channel A, B, C, etc.
19768  Returns:
19769  Direction of the selected port of type PORTS_DATA_MASK
19770  Example:
19771  <code>
19772 
19773  // Reads the direction of Port C pins
19774  PORTS_DATA_MASK readDir = PLIB_PORTS_DirectionGet(PORTS_ID_0, PORT_CHANNEL_C);
19775 
19776  </code>
19777  Remarks:
19778  This feature may not be available on all devices. Please refer to the
19779  specific device data sheet to determine availability or use
19780  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19781  this feature is available.
19782 */
19783 
19786  PORTS_MODULE_ID index ,
19787  PORTS_CHANNEL channel ) ;
19788 // *****************************************************************************
19789 /* Function:
19790  void PLIB_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19791  PORTS_DATA_MASK mask )
19792  Summary:
19793  Enables the open drain functionality for the selected port pins.
19794  Description:
19795  This function enables the open drain functionality for the selected port pins.
19796  This function does not perform atomic register access.
19797  Precondition:
19798  None.
19799  Parameters:
19800  index - Identifier for the device instance to be configured
19801  channel - Identifier for the Ports channel A, B, C, etc.
19802  mask - Identifies the pins for the open drain to be enabled
19803  Returns:
19804  None.
19805  Example:
19806  <code>
19807 
19808  // Enable Open Drain for RC0, RC1 and RC2 pins
19809  PLIB_PORTS_OpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19810 
19811  </code>
19812  Remarks:
19813  This feature may not be available on all devices. Please refer to the
19814  specific device data sheet to determine availability or use
19815  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19816  this feature is available.
19817 */
19818 
19819 void
19821  PORTS_MODULE_ID index ,
19822  PORTS_CHANNEL channel ,
19823  PORTS_DATA_MASK mask ) ;
19824 // *****************************************************************************
19825 /* Function:
19826  void PLIB_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19827  PORTS_DATA_MASK mask )
19828  Summary:
19829  Disables the open drain functionality for the selected port.
19830  Description:
19831  This function disables the open drain functionality for the selected port.
19832  This function does not perform atomic register access.
19833 
19834  Precondition:
19835  None.
19836  Parameters:
19837  index - Identifier for the device instance to be configured
19838  channel - Identifier for the Ports channel A, B, C, etc.
19839  mask - Identifies the pins for the open drain to be disabled
19840  Returns:
19841  None.
19842  Example:
19843  <code>
19844 
19845  // Disable Open Drain for RC0, RC1 and RC2 pins
19846  PLIB_PORTS_OpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19847 
19848  </code>
19849  Remarks:
19850  This feature may not be available on all devices. Please refer to the
19851  specific device data sheet to determine availability or use
19852  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19853  this feature is available.
19854 */
19855 
19856 void
19858  PORTS_MODULE_ID index ,
19859  PORTS_CHANNEL channel ,
19860  PORTS_DATA_MASK mask ) ;
19861 // *****************************************************************************
19862 /* Function:
19863  void PLIB_PORTS_ChannelModeSelect
19864  (
19865  PORTS_MODULE_ID index,
19866  PORTS_CHANNEL channel,
19867  PORTS_DATA_MASK modeMask,
19868  PORTS_PIN_MODE mode
19869  );
19870  Summary:
19871  Enables the selected channel pins as analog or digital.
19872  Description:
19873  This function enables the selected channel pins as analog or digital.
19874  This function does not perform atomic register access.
19875  Precondition:
19876  None.
19877  Parameters:
19878  index - Identifier for the device instance to be configured
19879  channel - Port pin channel
19880  modeMask - Identifies the pins whose mode has to be modified.
19881  Modes of the pins whose corresponding bit is '1' get
19882  modified, mode of the other pins remains the same.
19883  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
19884  Returns:
19885  None.
19886  Example:
19887  <code>
19888 
19889  // Make pins RC5, RC8 and RC13 Analog
19890  PLIB_PORTS_ChannelModeSelect(PORTS_ID_0, PORT_CHANNEL_C, 0x2120, PORTS_PIN_MODE_ANALOG);
19891 
19892  </code>
19893  Remarks:
19894  This function is only available in devices with PPS. For Non-PPS devices, use the
19895  PLIB_PORTS_AnPinsModeSelect function.
19896 
19897  This feature may not be available on all devices. Please refer to the
19898  specific device data sheet to determine availability or use
19899  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
19900  this feature is available.
19901 */
19902 
19903 void
19905  PORTS_MODULE_ID index ,
19906  PORTS_CHANNEL channel ,
19907  PORTS_DATA_MASK modeMask ,
19908  PORTS_PIN_MODE mode ) ;
19909 // *****************************************************************************
19910 /* Function:
19911  void PLIB_PORTS_ChannelChangeNoticePullUpEnable
19912  (
19913  PORTS_MODULE_ID index,
19914  PORTS_CHANNEL channel,
19915  PORTS_DATA_MASK mask
19916  );
19917  Summary:
19918  Enables Change Notice pull-up for the selected channel pins.
19919  Description:
19920  This function enables the Change Notice pull-up for the selected
19921  channel pins.
19922  This function does not perform atomic register access.
19923  Precondition:
19924  None.
19925  Parameters:
19926  index - Identifier for the device instance to be configured
19927  channel - Port pin channel
19928  mask - Identifies the pins of the pull-up to be enabled
19929  Returns:
19930  None.
19931  Example:
19932  <code>
19933 
19934  // Enable pull-up for RC5, RC8 and RC13 pins
19935  PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_ID_0, PORT_CHANNEL_C,
19936  0x2120);
19937  </code>
19938  Remarks:
19939  This function is only available in devices with PPS. For Non-PPS devices, use the
19940  PLIB_PORTS_CnPinsPullUpEnable function.
19941 
19942  This feature may not be available on all devices. Please refer to the
19943  specific device data sheet to determine availability or use
19944  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19945  determine whether this feature is available.
19946 */
19947 
19948 void
19950  PORTS_MODULE_ID index ,
19951  PORTS_CHANNEL channel ,
19952  PORTS_DATA_MASK mask ) ;
19953 // *****************************************************************************
19954 /* Function:
19955  void PLIB_PORTS_ChannelChangeNoticePullUpDisable
19956  (
19957  PORTS_MODULE_ID index,
19958  PORTS_CHANNEL channel,
19959  PORTS_DATA_MASK mask
19960  );
19961  Summary:
19962  Disables Change Notice pull-up for the selected channel pins.
19963  Description:
19964  This function Disables the Change Notice pull-up for the selected
19965  channel pins.
19966  PLIB_PORTS_ChannelChangeNoticePullUpDisable
19967  Precondition:
19968  None.
19969  Parameters:
19970  index - Identifier for the device instance to be configured
19971  channel - Port pin channel
19972  mask - Identifies the pins of the pull-up to be disabled
19973  Returns:
19974  None.
19975  Example:
19976  <code>
19977 
19978  // Disable pull-up for RC5, RC8 and RC13 pins
19979  PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_ID_0, PORT_CHANNEL_C,
19980  0x2120);
19981  </code>
19982  Remarks:
19983  This function is only available in devices with PPS. For Non-PPS devices, use the
19984  PLIB_PORTS_CnPinsPullUpDisable function.
19985 
19986  This feature may not be available on all devices. Please refer to the
19987  specific device data sheet to determine availability or use
19988  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19989  determine whether this feature is available.
19990 */
19991 
19992 void
19994  PORTS_MODULE_ID index ,
19995  PORTS_CHANNEL channel ,
19996  PORTS_DATA_MASK mask ) ;
19997 // *****************************************************************************
19998 /* Function:
19999  void PLIB_PORTS_ChannelChangeNoticePullDownEnable
20000  (
20001  PORTS_MODULE_ID index,
20002  PORTS_CHANNEL channel,
20003  PORTS_DATA_MASK mask
20004  );
20005  Summary:
20006  Enables Change Notice pull-down for the selected channel pins.
20007  Description:
20008  This function enables the Change Notice pull-down for the selected
20009  channel pins.
20010  This function does not perform atomic register access.
20011  Precondition:
20012  None.
20013  Parameters:
20014  index - Identifier for the device instance to be configured
20015  channel - Port pin channel
20016  mask - Identifies the pins for the pull-down to be enabled
20017  Returns:
20018  None.
20019  Example:
20020  <code>
20021 
20022  // Enable pull-down for RC5, RC8 and RC13 pins
20023  PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_ID_0, PORT_CHANNEL_C,
20024  0x2120);
20025  </code>
20026  Remarks:
20027  This feature may not be available on all devices. Please refer to the
20028  specific device data sheet to determine availability or use
20029  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20030  determine whether this feature is available.
20031 */
20032 
20033 void
20035  PORTS_MODULE_ID index ,
20036  PORTS_CHANNEL channel ,
20037  PORTS_DATA_MASK mask ) ;
20038 // *****************************************************************************
20039 /* Function:
20040  void PLIB_PORTS_ChannelChangeNoticePullDownDisable
20041  (
20042  PORTS_MODULE_ID index,
20043  PORTS_CHANNEL channel,
20044  PORTS_DATA_MASK mask
20045  );
20046  Summary:
20047  Disables Change Notice pull-down for the selected channel pins.
20048  Description:
20049  This function Disables the Change Notice pull-down for the selected
20050  channel pins.
20051  This function does not perform atomic register access.
20052  Precondition:
20053  None.
20054  Parameters:
20055  index - Identifier for the device instance to be configured
20056  channel - Port pin channel
20057  mask - Identifies the pins for the pull-down to be disabled
20058  Returns:
20059  None.
20060  Example:
20061  <code>
20062 
20063  // Disable pull-down for RC5, RC8 and RC13 pins
20064  PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_ID_0, PORT_CHANNEL_C,
20065  0x2120);
20066  </code>
20067  Remarks:
20068  This feature may not be available on all devices. Please refer to the
20069  specific device data sheet to determine availability or use
20070  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20071  determine whether this feature is available.
20072 */
20073 
20074 void
20076  PORTS_MODULE_ID index ,
20077  PORTS_CHANNEL channel ,
20078  PORTS_DATA_MASK mask ) ;
20079 // *****************************************************************************
20080 /* Function:
20081  void PLIB_PORTS_ChannelChangeNoticeEnable
20082  (
20083  PORTS_MODULE_ID index,
20084  PORTS_CHANNEL channel,
20085  PORTS_DATA_MASK mask
20086  );
20087  Summary:
20088  Enables CN interrupt for the selected pins of a channel.
20089  Description:
20090  This function enables Change Notice interrupt for the selected port
20091  pins of a channel.
20092  This function does not perform atomic register access.
20093  Precondition:
20094  None.
20095  Parameters:
20096  index - Identifier for the device instance to be configured
20097  channel - Port pin channel
20098  mask - Identifies the pins for which change notification is
20099  to be enabled
20100  Returns:
20101  None.
20102  Example:
20103  <code>
20104 
20105  // Enable CN interrupt for RC5, RC8 and RC13 pins
20106  PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20107 
20108  </code>
20109  Remarks:
20110  This function is only available in devices with PPS. For Non-PPS devices, use the
20111  PLIB_PORTS_CnPinsEnable function.
20112 
20113  This feature may not be available on all devices. Please refer to the
20114  specific device data sheet to determine availability or use
20115  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20116  determine whether this feature is available.
20117 */
20118 
20119 void
20121  PORTS_MODULE_ID index ,
20122  PORTS_CHANNEL channel ,
20123  PORTS_DATA_MASK mask ) ;
20124 // *****************************************************************************
20125 /* Function:
20126  void PLIB_PORTS_ChannelChangeNoticeDisable
20127  (
20128  PORTS_MODULE_ID index,
20129  PORTS_CHANNEL channel,
20130  PORTS_DATA_MASK mask
20131  );
20132  Summary:
20133  Disables CN interrupt for the selected pins of a channel.
20134  Description:
20135  This function Disables Change Notice interrupt for the selected port
20136  pins of a channel.
20137  This function does not perform atomic register access.
20138  Precondition:
20139  None.
20140  Parameters:
20141  index - Identifier for the device instance to be configured
20142  channel - Port pin channel
20143  mask - Identifies the pins for which change notification is
20144  to be disabled
20145  Returns:
20146  None.
20147  Example:
20148  <code>
20149 
20150  // Disable CN interrupt for RC5, RC8 and RC13 pins
20151  PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20152 
20153  </code>
20154  Remarks:
20155  This function is only available in devices with PPS. For Non-PPS devices, use the
20156  PLIB_PORTS_CnPinsDisable function.
20157 
20158  This feature may not be available on all devices. Please refer to the
20159  specific device data sheet to determine availability or use
20160  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20161  determine whether this feature is available.
20162 */
20163 
20164 void
20166  PORTS_MODULE_ID index ,
20167  PORTS_CHANNEL channel ,
20168  PORTS_DATA_MASK mask ) ;
20169 // *****************************************************************************
20170 /* Function:
20171  void PLIB_PORTS_AnPinsModeSelect
20172  (
20173  PORTS_MODULE_ID index,
20174  PORTS_AN_PIN anPins,
20175  PORTS_PIN_MODE mode
20176  );
20177  Summary:
20178  Enables the selected AN pins as analog or digital.
20179  Description:
20180  This function enables the selected AN pins as analog or digital.
20181  This function does not perform atomic register access.
20182  Precondition:
20183  None.
20184  Parameters:
20185  index - Identifier for the device instance to be configured
20186  anPins - AN pins whose mode is to be changed. Multiple AN pins
20187  can be ORed.
20188  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
20189  Returns:
20190  None.
20191  Example:
20192  <code>
20193 
20194  // Make pins AN5, AN8 and AN13 Analog
20195  PLIB_PORTS_AnPinsModeSelect(PORTS_ID_0, PORTS_AN_PIN_5 |
20196  PORTS_AN_PIN_8 |
20197  PORTS_AN_PIN_13,
20198  PORTS_PIN_MODE_ANALOG);
20199 
20200  </code>
20201  Remarks:
20202  This function is only available in devices without PPS feature. For PPS
20203  devices, use the PLIB_PORTS_ChannelModeSelect function.
20204 
20205  This feature may not be available on all devices. Please refer to the
20206  specific device data sheet to determine availability or use
20207  PLIB_PORTS_ExistsAnPinsMode in your application to determine whether
20208  this feature is available.
20209 */
20210 
20211 void
20213  PORTS_MODULE_ID index ,
20214  PORTS_AN_PIN anPins ,
20215  PORTS_PIN_MODE mode ) ;
20216 // *****************************************************************************
20217 /* Function:
20218  void PLIB_PORTS_CnPinsPullUpEnable
20219  (
20220  PORTS_MODULE_ID index,
20221  PORTS_CN_PIN cnPins
20222  );
20223  Summary:
20224  Enables Change Notice pull-up for the selected channel pins.
20225  Description:
20226  This function enables the Change Notice pull-up for the selected
20227  channel pins.
20228  This function performs atomic register access.
20229  Precondition:
20230  None.
20231  Parameters:
20232  index - Identifier for the device instance to be configured
20233  cnPins - CN pins whose pull-up is to be enabled. Multiple CN pins
20234  can be ORed.
20235  Returns:
20236  None.
20237  Example:
20238  <code>
20239 
20240  // Enable pull-up for CN5, CN8 and CN13 pins
20241  PLIB_PORTS_CnPinsPullUpEnable(PORTS_ID_0, CHANGE_NOTICE_PIN_5 |
20242  CHANGE_NOTICE_PIN_8 |
20243  CHANGE_NOTICE_PIN_13);
20244 
20245  </code>
20246  Remarks:
20247  This function is only available in devices without PPS feature. For PPS
20248  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpEnable function.
20249 
20250  This feature may not be available on all devices. Please refer to the
20251  specific device data sheet to determine availability or use
20252  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20253  determine whether this feature is available.
20254 */
20255 
20256 void
20258  PORTS_MODULE_ID index ,
20259  PORTS_CN_PIN cnPins ) ;
20260 // *****************************************************************************
20261 /* Function:
20262  void PLIB_PORTS_CnPinsPullUpDisable
20263  (
20264  PORTS_MODULE_ID index,
20265  PORTS_CN_PIN cnPins
20266  );
20267  Summary:
20268  Disables Change Notice pull-up for the selected channel pins.
20269  Description:
20270  This function Disables the Change Notice pull-up for the selected
20271  channel pins.
20272  This function performs atomic register access.
20273  Precondition:
20274  None.
20275  Parameters:
20276  index - Identifier for the device instance to be configured
20277  cnPins - CN pins whose pull-up is to be disabled. Multiple CN pins
20278  can be ORed.
20279  Returns:
20280  None.
20281  Example:
20282  <code>
20283 
20284  // Disable pull-up for CN5, CN8 and CN13 pins
20285  PLIB_PORTS_CnPinsPullUpDisable(PORTS_ID_0,
20286  CHANGE_NOTICE_PIN_5 |
20287  CHANGE_NOTICE_PIN_8 |
20288  CHANGE_NOTICE_PIN_13);
20289 
20290  </code>
20291  Remarks:
20292  This function is only available in devices without PPS feature. For PPS
20293  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpDisable function.
20294 
20295  This feature may not be available on all devices. Please refer to the
20296  specific device data sheet to determine availability or use
20297  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20298  determine whether this feature is available.
20299 */
20300 
20301 void
20303  PORTS_MODULE_ID index ,
20304  PORTS_CN_PIN cnPins ) ;
20305 // *****************************************************************************
20306 /* Function:
20307  void PLIB_PORTS_CnPinsEnable
20308  (
20309  PORTS_MODULE_ID index,
20310  PORTS_CN_PIN cnPins
20311  );
20312  Summary:
20313  Enables CN interrupt for the selected pins of a channel.
20314  Description:
20315  This function enables Change Notice interrupt for the selected port
20316  pins of a channel.
20317  This function performs atomic register access.
20318  Precondition:
20319  None.
20320  Parameters:
20321  index - Identifier for the device instance to be configured
20322  cnPins - CN pins to be enabled. Multiple CN pins can be ORed.
20323  Returns:
20324  None.
20325  Example:
20326  <code>
20327 
20328  // Enable CN interrupt for CN5, CN8 and CN13 pins
20329  PLIB_PORTS_CnPinsEnable(PORTS_ID_0,
20330  CHANGE_NOTICE_PIN_5 |
20331  CHANGE_NOTICE_PIN_8 |
20332  CHANGE_NOTICE_PIN_13);
20333 
20334  </code>
20335  Remarks:
20336  This function is only available in devices without PPS feature. For PPS
20337  devices, use the PLIB_PORTS_ChannelChangeNoticeEnable function.
20338 
20339  This feature may not be available on all devices. Please refer to the
20340  specific device data sheet to determine availability or use
20341  PLIB_PORTS_ExistsPinChangeNotice in your application to
20342  determine whether this feature is available.
20343 */
20344 
20345 void
20347  PORTS_MODULE_ID index ,
20348  PORTS_CN_PIN cnPins ) ;
20349 // *****************************************************************************
20350 /* Function:
20351  void PLIB_PORTS_CnPinsDisable
20352  (
20353  PORTS_MODULE_ID index,
20354  PORTS_CN_PIN cnPins
20355  );
20356  Summary:
20357  Disables CN interrupt for the selected pins of a channel.
20358  Description:
20359  This function Disables Change Notice interrupt for the selected port
20360  pins of a channel.
20361  This function performs atomic register access.
20362  Precondition:
20363  None.
20364  Parameters:
20365  index - Identifier for the device instance to be configured
20366  cnPins - CN pins to be disabled. Multiple CN pins can be ORed.
20367  Returns:
20368  None.
20369  Example:
20370  <code>
20371 
20372  // Disable CN interrupt for CN5, CN8 and CN13 pins
20373  PLIB_PORTS_CnPinsDisable(PORTS_ID_0,
20374  CHANGE_NOTICE_PIN_5 |
20375  CHANGE_NOTICE_PIN_8 |
20376  CHANGE_NOTICE_PIN_13);
20377 
20378  </code>
20379  Remarks:
20380  This function is only available in devices without PPS feature. For PPS
20381  devices, use the PLIB_PORTS_ChannelChangeNoticeDisable function.
20382 
20383  This feature may not be available on all devices. Please refer to the
20384  specific device data sheet to determine availability or use
20385  PLIB_PORTS_ExistsPinChangeNotice in your application to
20386  determine whether this feature is available.
20387 */
20388 
20389 void
20391  PORTS_MODULE_ID index ,
20392  PORTS_CN_PIN cnPins ) ;
20393 // *****************************************************************************
20394 /* Function:
20395  void PLIB_PORTS_ChangeNoticeEnable( PORTS_MODULE_ID index )
20396  Summary:
20397  Global Change Notice enable.
20398  Description:
20399  This function enables the global Change Notice feature.
20400  This function performs atomic register access.
20401  Precondition:
20402  None.
20403  Parameters:
20404  index - Identifier for the device instance to be configured
20405  Returns:
20406  None.
20407  Example:
20408  <code>
20409 
20410  // Enable Change Notification
20411  PLIB_PORTS_ChangeNoticeEnable(PORTS_ID_0);
20412 
20413  </code>
20414  Remarks:
20415  This function is only available in devices without PPS. For PPS devices, use the
20416  PLIB_PORTS_ChangeNoticePerPortTurnOn function.
20417 
20418  This feature may not be available on all devices. Please refer to the
20419  specific device data sheet to determine availability or use
20420  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20421  this feature is available.
20422 */
20423 
20424 void
20426  PORTS_MODULE_ID index ) ;
20427 // *****************************************************************************
20428 /* Function:
20429  void PLIB_PORTS_ChangeNoticeDisable( PORTS_MODULE_ID index )
20430  Summary:
20431  Global Change Notice disable.
20432  Description:
20433  This function disables the global Change Notice feature.
20434  Precondition:
20435  None.
20436  Parameters:
20437  index - Identifier for the device instance to be configured
20438  Returns:
20439  None.
20440  Example:
20441  <code>
20442 
20443  // Disable Change Notification
20444  PLIB_PORTS_ChangeNoticeDisable(PORTS_ID_0);
20445 
20446  </code>
20447  Remarks:
20448  This function is only available in devices without PPS. For PPS devices, use the
20449  PLIB_PORTS_ChangeNoticePerPortTurnOff function.
20450 
20451  This feature may not be available on all devices. Please refer to the
20452  specific device data sheet to determine availability or use
20453  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20454  this feature is available.
20455 */
20456 
20457 void
20459  PORTS_MODULE_ID index ) ;
20460 // *****************************************************************************
20461 /* Function:
20462  void PLIB_PORTS_PinChangeNoticeEnable( PORTS_MODULE_ID index,
20463  PORTS_CHANGE_NOTICE_PIN pinNum )
20464  Summary:
20465  Port pin Change Notice interrupt enable.
20466  Description:
20467  This function enables the port pin Change Notice feature.
20468  This function performs atomic register access.
20469  Precondition:
20470  None.
20471  Parameters:
20472  index - Identifier for the device instance to be configured
20473  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20474  Returns:
20475  None.
20476  Example:
20477  <code>
20478 
20479  // Enable Change Notice interrupt for pin CN13
20480  PLIB_PORTS_PinChangeNoticeEnable(PORTS_ID_0, CN13);
20481 
20482  </code>
20483  Remarks:
20484  This function is only available in devices without PPS. For PPS devices, use the
20485  PLIB_PORTS_PinChangeNoticePerPortEnable function.
20486 
20487  This feature may not be available on all devices. Please refer to the
20488  specific device data sheet to determine availability or use
20489  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20490  this feature is available.
20491 */
20492 
20493 void
20495  PORTS_MODULE_ID index ,
20496  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20497 // *****************************************************************************
20498 /* Function:
20499  void PLIB_PORTS_PinChangeNoticeDisable( PORTS_MODULE_ID index,
20500  PORTS_CHANGE_NOTICE_PIN pinNum )
20501  Summary:
20502  Port pin Change Notice disable.
20503  Description:
20504  This function disables the port pin Change Notice feature.
20505  This function performs atomic register access.
20506  Precondition:
20507  None.
20508  Parameters:
20509  index - Identifier for the device instance to be configured
20510  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20511  Returns:
20512  None.
20513  Example:
20514  <code>
20515 
20516  // Disable Change Notice interrupt for pin CN13
20517  PLIB_PORTS_PinChangeNoticeDisable(PORTS_ID_0, CN13);
20518 
20519  </code>
20520  Remarks:
20521  This function is only available in devices without PPS. For PPS devices, use the
20522  PLIB_PORTS_PinChangeNoticePerPortDisable function.
20523 
20524  This feature may not be available on all devices. Please refer to the
20525  specific device data sheet to determine availability or use
20526  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20527  this feature is available.
20528 */
20529 
20530 void
20532  PORTS_MODULE_ID index ,
20533  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20534 // *****************************************************************************
20535 /* Function:
20536  void PLIB_PORTS_ChangeNoticeInIdleEnable( PORTS_MODULE_ID index )
20537  Summary:
20538  CPU Idle mode does not affect Change Notice operation.
20539  Description:
20540  This function makes sure that Change Notice feature continues working in
20541  Idle mode.
20542  This function performs atomic register access.
20543 
20544  Precondition:
20545  None.
20546  Parameters:
20547  index - Identifier for the device instance to be configured
20548  Returns:
20549  None.
20550  Example:
20551  <code>
20552 
20553  // Change notification feature will be working even when CPU goes to
20554  // Idle mode
20555  PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_ID_0);
20556 
20557  </code>
20558  Remarks:
20559  This function is only available in devices without PPS. For PPS devices, use the
20560  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable function.
20561 
20562  This feature may not be available on all devices. Please refer to the
20563  specific device data sheet to determine availability or use
20564  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
20565  this feature is available.
20566 */
20567 
20568 void
20570  PORTS_MODULE_ID index ) ;
20571 // *****************************************************************************
20572 /* Function:
20573  void PLIB_PORTS_ChangeNoticeInIdleDisable( PORTS_MODULE_ID index )
20574  Summary:
20575  CPU Idle halts the Change Notice operation.
20576  Description:
20577  This function halts the Change Notice operation when the CPU enters
20578  Idle mode.
20579  This function performs atomic register access.
20580  Precondition:
20581  None.
20582  Parameters:
20583  index - Identifier for the device instance to be configured
20584  Returns:
20585  None.
20586  Example:
20587  <code>
20588  // Halts the Change notification operation when CPU enters Idle mode
20589  PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_ID_0);
20590 
20591  </code>
20592  Remarks:
20593  This function is only available in devices without PPS. For PPS devices, use the
20594  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable function.
20595 
20596  This feature may not be available on all devices. Please refer to the
20597  specific device data sheet to determine availability or use
20598  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
20599  this feature is available.
20600 */
20601 
20602 void
20604  PORTS_MODULE_ID index ) ;
20605 // *****************************************************************************
20606 /* Function:
20607  void PLIB_PORTS_ChangeNoticePullUpEnable( PORTS_MODULE_ID index,
20608  PORTS_CHANGE_NOTICE_PIN pinNum )
20609  Summary:
20610  Enable pull-up on input change.
20611  Description:
20612  This function enables pull-up on selected input change notification pin.
20613  This function performs atomic register access.
20614  Precondition:
20615  None.
20616  Parameters:
20617  index - Identifier for the device instance to be configured
20618  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20619  Returns:
20620  None.
20621  Example:
20622  <code>
20623 
20624  // Enable pull-up on pin CN13
20625  PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_ID_0, CN13);
20626 
20627  </code>
20628  Remarks:
20629  This function is only available in devices without PPS. For PPS devices, use the
20630  PLIB_PORTS_ChangeNoticePullUpPerPortEnable function.
20631 
20632  This feature may not be available on all devices. Please refer to the
20633  specific device data sheet to determine availability or use
20634  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
20635  this feature is available.
20636 */
20637 
20638 void
20640  PORTS_MODULE_ID index ,
20641  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20642 // *****************************************************************************
20643 /* Function:
20644  void PLIB_PORTS_ChangeNoticePullUpDisable( PORTS_MODULE_ID index,
20645  PORTS_CHANGE_NOTICE_PIN pinNum )
20646  Summary:
20647  Disable pull-up on input change.
20648  Description:
20649  This function disables pull-up on selected input change notification pin.
20650  This function performs atomic register access.
20651  Precondition:
20652  None.
20653  Parameters:
20654  index - Identifier for the device instance to be configured
20655  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20656  Returns:
20657  None.
20658  Example:
20659  <code>
20660 
20661  // Disable pull-up on pin CN13
20662  PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_ID_0, CN13);
20663 
20664  </code>
20665  Remarks:
20666  This function is only available in devices without PPS. For PPS devices, use the
20667  PLIB_PORTS_ChangeNoticePullUpPerPortDisable function.
20668 
20669  This feature may not be available on all devices. Please refer to the
20670  specific device data sheet to determine availability or use
20671  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
20672  this feature is available.
20673 */
20674 
20675 void
20677  PORTS_MODULE_ID index ,
20678  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20679 // *****************************************************************************
20680 /* Function:
20681  void PLIB_PORTS_ChannelSlewRateSelect
20682  (
20683  PORTS_MODULE_ID index,
20684  PORTS_CHANNEL channel,
20685  PORTS_DATA_MASK channelMask,
20686  PORTS_PIN_SLEW_RATE slewRate
20687  );
20688  Summary:
20689  Selects the slew rate for selected channel pins.
20690  Description:
20691  This function selects the slew rate for selected channel pins.
20692  This function does not perform atomic register access.
20693  Precondition:
20694  None.
20695  Parameters:
20696  index - Identifier for the device instance to be configured
20697  channel - Port pin channel
20698  channelMask - Identifies the pins for which slew rate has to be modified.
20699  Slew rate of the pins which corresponding bit is "1" get
20700  modified, slew rate of the other pins remains the same.
20701  slewRate - One of the possible values of PORTS_PIN_SLEW_RATE.
20702  Returns:
20703  None.
20704  Example:
20705  <code>
20706 
20707  // Make slew rate of pins RC5, RC8 and RC13 slowest
20708  PLIB_PORTS_ChannelSlewRateSelect(PORTS_ID_0,
20709  PORT_CHANNEL_C,
20710  0x2120,
20711  PORTS_PIN_SLEW_RATE_SLOWEST);
20712 
20713  </code>
20714  Remarks:
20715  This feature may not be available on all devices. Please refer to the
20716  specific device data sheet to determine availability or use
20717  PLIB_PORTS_ExistsSlewRateControl in your application to determine
20718  whether this feature is available.
20719 */
20720 
20721 void
20723  PORTS_MODULE_ID index ,
20724  PORTS_CHANNEL channel ,
20725  PORTS_DATA_MASK channelMask ,
20726  PORTS_PIN_SLEW_RATE slewRate ) ;
20727 // *****************************************************************************
20728 /* Function:
20729 PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet
20730  (
20731  PORTS_MODULE_ID index,
20732  PORTS_CHANNEL channel,
20733  PORTS_BIT_POS bitPos
20734  );
20735  Summary:
20736  Gets the slew rate for selected port pin.
20737  Description:
20738  This function gets the slew rate of selected port pin.
20739  This function does not perform atomic register access.
20740  Precondition:
20741  None.
20742  Parameters:
20743  index - Identifier for the device instance to be configured
20744  channel - Port pin channel
20745  bitPos - One of the possible values of PORTS_BIT_POS.
20746  Returns:
20747  One of the possible values of PORTS_PIN_SLEW_RATE.
20748  Example:
20749  <code>
20750  PORTS_PIN_SLEW_RATE slewRate;
20751 
20752  // Get the slew rate of pin RC1
20753  slewRate = PLIB_PORTS_PinSlewRateGet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1);
20754 
20755  </code>
20756  Remarks:
20757  This feature may not be available on all devices. Please refer to the
20758  specific device data sheet to determine availability or use
20759  PLIB_PORTS_ExistsSlewRateControl in your application to determine
20760  whether this feature is available.
20761 */
20762 
20763 PORTS_PIN_SLEW_RATE
20765  PORTS_MODULE_ID index ,
20766  PORTS_CHANNEL channel ,
20767  PORTS_BIT_POS bitPos ) ;
20768 // *****************************************************************************
20769 /* Function:
20770  void PLIB_PORTS_ChannelChangeNoticeMethodSelect
20771  (
20772  PORTS_MODULE_ID index,
20773  PORTS_CHANNEL channel,
20774  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod
20775  );
20776  Summary:
20777  Selects the Change Notice style for selected port channel.
20778  Description:
20779  This function selects the Change Notice style (or method) for selected port
20780  channel. It allows user to select whether the Change Notice detection will
20781  happen based on edge transition or level transition on all the CN pins of a
20782  particular channel.
20783  This function does not perform atomic register access.
20784  Precondition:
20785  None.
20786  Parameters:
20787  index - Identifier for the device instance to be configured
20788  channel - Port pin channel
20789  changeNoticeMethod - One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
20790  Returns:
20791  None.
20792  Example:
20793  <code>
20794  PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_ID_0, PORT_CHANNEL_C,
20795  PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT);
20796  </code>
20797  Remarks:
20798  This feature may not be available on all devices. Please refer to the
20799  specific device data sheet to determine availability or use
20800  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
20801  whether this feature is available.
20802 */
20803 
20804 void
20806  PORTS_MODULE_ID index ,
20807  PORTS_CHANNEL channel ,
20808  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod ) ;
20809 // *****************************************************************************
20810 /* Function:
20811  PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet
20812  (
20813  PORTS_MODULE_ID index,
20814  PORTS_CHANNEL channel
20815  );
20816  Summary:
20817  Gets the Change Notice style for the selected port channel.
20818  Description:
20819  This function gets the Change Notice style (or method) for the selected port
20820  channel.
20821  This function does not perform atomic register access.
20822  Precondition:
20823  None.
20824  Parameters:
20825  index - Identifier for the device instance to be configured
20826  channel - Port pin channel
20827  Returns:
20828  One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
20829  Example:
20830  <code>
20831  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod;
20832  changeNoticeMethod = PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_ID_0, PORT_CHANNEL_C);
20833  </code>
20834  Remarks:
20835  This feature may not be available on all devices. Please refer to the
20836  specific device data sheet to determine availability or use
20837  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
20838  whether this feature is available.
20839 */
20840 
20841 PORTS_CHANGE_NOTICE_METHOD
20843  PORTS_MODULE_ID index ,
20844  PORTS_CHANNEL channel ) ;
20845 // *****************************************************************************
20846 /* Function:
20847  void PLIB_PORTS_ChannelChangeNoticeEdgeEnable
20848  (
20849  PORTS_MODULE_ID index,
20850  PORTS_CHANNEL channel,
20851  PORTS_DATA_MASK edgeRisingMask,
20852  PORTS_DATA_MASK edgeFallingMask
20853  );
20854  Summary:
20855  Enables selected type of edge for selected CN pins.
20856  Description:
20857  This function Enables selected type of edge (falling or rising) for
20858  selected CN pins of a port channel.
20859  This function does not perform atomic register access.
20860  Precondition:
20861  Change Notice method should be selected as
20862  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
20863  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
20864  Parameters:
20865  index - Identifier for the device instance to be configured
20866  channel - Port pin channel
20867  edgeRisingMask - Identifies the pins for which Change Notice has to be
20868  enabled for rising edge. Change Notice interrupt at rising
20869  edge is enabled for the pins which corresponding bit is
20870  '1', for the other pins it remains the same.
20871  edgeFallingMask - Identifies the pins for which Change Notice has to be
20872  enabled for falling edge. Change Notice interrupt at
20873  falling edge is enabled for the pins which corresponding
20874  bit is '1', for the other pins it remains the same.
20875  Returns:
20876  None.
20877  Example:
20878  <code>
20879  // Enable Change Notice at rising edge for RC1 pin and at falling edge for
20880  // RC1 & RC5 pins.
20881  PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
20882  </code>
20883  Remarks:
20884  This feature is not available on all devices. Please refer to the
20885  specific device data sheet to determine availability or use
20886  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20887  whether this feature is available.
20888 */
20889 
20890 void
20892  PORTS_MODULE_ID index ,
20893  PORTS_CHANNEL channel ,
20894  PORTS_DATA_MASK edgeRisingMask ,
20895  PORTS_DATA_MASK edgeFallingMask ) ;
20896 // *****************************************************************************
20897 /* Function:
20898  void PLIB_PORTS_ChannelChangeNoticeEdgeDisable
20899  (
20900  PORTS_MODULE_ID index,
20901  PORTS_CHANNEL channel,
20902  PORTS_DATA_MASK edgeRisingMask,
20903  PORTS_DATA_MASK edgeFallingMask
20904  );
20905  Summary:
20906  Disables selected type of edge for selected CN pins.
20907  Description:
20908  This function Disables selected type of edge (falling or rising) for
20909  selected CN pins of a port channel.
20910  This function does not perform atomic register access.
20911  Precondition:
20912  Change Notice method should be selected as
20913  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
20914  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
20915  Parameters:
20916  index - Identifier for the device instance to be configured
20917  channel - Port pin channel
20918  edgeRisingMask - Identifies the pins for which Change Notice has to be
20919  enabled for rising edge. Change notice interrupt at rising
20920  edge is enabled for the pins which corresponding bit is
20921  '1', for the other pins it remains the same.
20922  edgeFallingMask - Identifies the pins for which Change Notice has to be
20923  enabled for falling edge. Change notice interrupt at
20924  falling edge is enabled for the pins which corresponding
20925  bit is '1', for the other pins it remains the same.
20926  Returns:
20927  None.
20928  Example:
20929  <code>
20930  // Disable Change Notice at rising edge for RC1 pin and at falling edge for
20931  // RC1 & RC5 pins.
20932  PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
20933  </code>
20934  Remarks:
20935  This feature is not available on all devices. Please refer to the
20936  specific device data sheet to determine availability or use
20937  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20938  whether this feature is available.
20939 */
20940 
20941 void
20943  PORTS_MODULE_ID index ,
20944  PORTS_CHANNEL channel ,
20945  PORTS_DATA_MASK edgeRisingMask ,
20946  PORTS_DATA_MASK edgeFallingMask ) ;
20947 // *****************************************************************************
20948 /* Function:
20949  bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
20950  (
20951  PORTS_MODULE_ID index,
20952  PORTS_CHANNEL channel,
20953  PORTS_BIT_POS bitPos,
20954  PORTS_CHANGE_NOTICE_EDGE cnEdgeType
20955  );
20956  Summary:
20957  Check if Change Notice edge is enabled or not.
20958  This function does not perform atomic register access.
20959  Description:
20960  This function checks if selected type of Change Notice edge is enabled on a
20961  particular port pin or not.
20962  This function does not perform atomic register access.
20963  Precondition:
20964  None.
20965  Parameters:
20966  index - Identifier for the device instance to be configured
20967  channel - Port pin channel
20968  bitPos - One of the possible values of PORTS_BIT_POS.
20969  cnEdgeType - Type of the edge which has to be checked.
20970 
20971  Returns:
20972  - true - Selected type of Change Notice Edge is enabled.
20973  - false - Selected type of Change Notice Edge is not enabled.
20974 
20975  Example:
20976  <code>
20977  // Check if Change Notice at rising edge is enabled or not for pin RC1.
20978  if (PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1, PORTS_CHANGE_NOTICE_EDGE_RISING))
20979  {
20980  // do something
20981  }
20982  </code>
20983  Remarks:
20984  This feature is not available on all devices. Please refer to the
20985  specific device data sheet to determine availability or use
20986  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20987  whether this feature is available.
20988 */
20989 
20990 bool
20992  PORTS_MODULE_ID index ,
20993  PORTS_CHANNEL channel ,
20994  PORTS_BIT_POS bitPos ,
20995  PORTS_CHANGE_NOTICE_EDGE cnEdgeType ) ;
20996 // *****************************************************************************
20997 /* Function:
20998  bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
20999  (
21000  PORTS_MODULE_ID index,
21001  PORTS_CHANNEL channel,
21002  PORTS_BIT_POS bitPos
21003  );
21004  Summary:
21005  Check Change Notice edge status.
21006  Description:
21007  This function checks whether or no a Change Notice edge transition has occurred
21008  on the selected port pin.
21009  This function does not perform atomic register access.
21010  Precondition:
21011  None.
21012  Parameters:
21013  index - Identifier for the device instance to be configured
21014  channel - Port pin channel
21015  bitPos - One of the possible values of PORTS_BIT_POS
21016 
21017  Returns:
21018  - true - Change Notice edge transition has occurred
21019  - false - Change Notice edge transition has not occurred
21020 
21021  Example:
21022  <code>
21023  // Check if Change Notice edge transition has occurred for pin RC1.
21024  if (PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1))
21025  {
21026  // do something
21027  }
21028  </code>
21029  Remarks:
21030  This feature is not available on all devices. Please refer to the
21031  specific device data sheet to determine availability or use
21032  PLIB_PORTS_ExistsChangeNoticeEdgeStatus in your application to determine
21033  whether this feature is available.
21034 */
21035 
21036 bool
21038  PORTS_MODULE_ID index ,
21039  PORTS_CHANNEL channel ,
21040  PORTS_BIT_POS bitPos ) ;
21041 // *****************************************************************************
21042 // *****************************************************************************
21043 // Section: Ports Peripheral Library Exists Functions
21044 // *****************************************************************************
21045 // *****************************************************************************
21046 /* The functions below indicate the existence of the features on the device.
21047 */
21048 //******************************************************************************
21049 /* Function:
21050  PLIB_PORTS_ExistsRemapInput( PORTS_MODULE_ID index )
21051  Summary:
21052  Identifies whether the RemapInput feature exists on the Ports module.
21053  Description:
21054  This function identifies whether the RemapInput feature is available on the
21055  Ports module.
21056  When this function returns true, this function is supported on the device:
21057  - PLIB_PORTS_RemapInput
21058  Preconditions:
21059  None.
21060  Parameters:
21061  index - Identifier for the device instance
21062  Returns:
21063  - true - The RemapInput feature is supported on the device
21064  - false - The RemapInput feature is not supported on the device
21065  Remarks:
21066  None.
21067 */
21068 
21069 bool
21071  PORTS_MODULE_ID index ) ;
21072 //******************************************************************************
21073 /* Function:
21074  PLIB_PORTS_ExistsRemapOutput( PORTS_MODULE_ID index )
21075  Summary:
21076  Identifies whether the RemapOutput feature exists on the Ports module.
21077  Description:
21078  This function identifies whether the RemapOutput feature is available on the
21079  Ports module.
21080  When this function returns true, this function is supported on the device:
21081  - PLIB_PORTS_RemapOutput
21082  Preconditions:
21083  None.
21084  Parameters:
21085  index - Identifier for the device instance
21086  Returns:
21087  - true - The RemapOutput feature is supported on the device
21088  - false - The RemapOutput feature is not supported on the device
21089  Remarks:
21090  None.
21091 */
21092 
21093 bool
21095  PORTS_MODULE_ID index ) ;
21096 //******************************************************************************
21097 /* Function:
21098  PLIB_PORTS_ExistsPinMode( PORTS_MODULE_ID index )
21099  Summary:
21100  Identifies whether the PinMode feature exists on the Ports module.
21101  Description:
21102  This function identifies whether the PinMode (Analog Pin or Digital Pin)
21103  feature is available on the Ports module.
21104  When this function returns true, this function is supported on the device:
21105  - PLIB_PORTS_PinModeSelect
21106  Preconditions:
21107  None.
21108  Parameters:
21109  index - Identifier for the device instance
21110  Returns:
21111  - true - The PinMode feature is supported on the device
21112  - false - The PinMode feature is not supported on the device
21113  Remarks:
21114  None.
21115 */
21116 
21117 bool
21119  PORTS_MODULE_ID index ) ;
21120 //******************************************************************************
21121 /* Function:
21122  PLIB_PORTS_ExistsAnPinsMode( PORTS_MODULE_ID index )
21123  Summary:
21124  Identifies whether the AnPinsMode feature exists on the Ports module.
21125  Description:
21126  This function identifies whether the AnPinsMode feature is available on the
21127  Ports module.
21128  When this function returns true, this function is supported on the device:
21129  - PLIB_PORTS_AnPinsModeSelect
21130  Preconditions:
21131  None.
21132  Parameters:
21133  index - Identifier for the device instance
21134  Returns:
21135  - true - The AnPinsMode feature is supported on the device
21136  - false - The AnPinsMode feature is not supported on the device
21137  Remarks:
21138  None.
21139 */
21140 
21141 bool
21143  PORTS_MODULE_ID index ) ;
21144 //******************************************************************************
21145 /* Function:
21146  PLIB_PORTS_ExistsPortsRead( PORTS_MODULE_ID index )
21147  Summary:
21148  Identifies whether the PortsRead feature exists on the Ports module.
21149  Description:
21150  This function identifies whether the PortsRead feature is available on the
21151  Ports module.
21152  When this function returns true, these functions are supported on the device:
21153  - PLIB_PORTS_PinGet
21154  - PLIB_PORTS_Read
21155  Preconditions:
21156  None.
21157  Parameters:
21158  index - Identifier for the device instance
21159  Returns:
21160  - true - The PortsRead feature is supported on the device
21161  - false - The PortsRead feature is not supported on the device
21162  Remarks:
21163  None.
21164 */
21165 
21166 bool
21168  PORTS_MODULE_ID index ) ;
21169 //******************************************************************************
21170 /* Function:
21171  PLIB_PORTS_ExistsLatchRead( PORTS_MODULE_ID index )
21172  Summary:
21173  Identifies whether the LatchRead feature exists on the Ports module.
21174  Description:
21175  This function identifies whether the LatchRead feature is available on the
21176  Ports module.
21177  When this function returns true, these functions are supported on the device:
21178  - PLIB_PORTS_PinGetLatched
21179  - PLIB_PORTS_ReadLatched
21180  Preconditions:
21181  None.
21182  Parameters:
21183  index - Identifier for the device instance
21184  Returns:
21185  - true - The LatchRead feature is supported on the device
21186  - false - The LatchRead feature is not supported on the device
21187  Remarks:
21188  None.
21189 */
21190 
21191 bool
21193  PORTS_MODULE_ID index ) ;
21194 //******************************************************************************
21195 /* Function:
21196  PLIB_PORTS_ExistsPortsWrite( PORTS_MODULE_ID index )
21197  Summary:
21198  Identifies whether the PortsWrite feature exists on the Ports module.
21199  Description:
21200  This function identifies whether the PortsWrite feature is available on the
21201  Ports module.
21202  When this function returns true, these functions are supported on the device:
21203  - PLIB_PORTS_PinWrite
21204  - PLIB_PORTS_PinSet
21205  - PLIB_PORTS_PinClear
21206  - PLIB_PORTS_PinToggle
21207  - PLIB_PORTS_Write
21208  - PLIB_PORTS_Set
21209  - PLIB_PORTS_Toggle
21210  - PLIB_PORTS_Clear
21211  Preconditions:
21212  None.
21213  Parameters:
21214  index - Identifier for the device instance
21215  Returns:
21216  - true - The PortsWrite feature is supported on the device
21217  - false - The PortsWrite feature is not supported on the device
21218  Remarks:
21219  None.
21220 */
21221 
21222 bool
21224  PORTS_MODULE_ID index ) ;
21225 //******************************************************************************
21226 /* Function:
21227  PLIB_PORTS_ExistsPortsDirection( PORTS_MODULE_ID index )
21228  Summary:
21229  Identifies whether the PortsDirection feature exists on the Ports module.
21230  Description:
21231  This function identifies whether the PortsDirection feature is available on the
21232  Ports module.
21233  When this function returns true, these functions are supported on the device:
21234  - PLIB_PORTS_PinDirectionInputSet
21235  - PLIB_PORTS_PinDirectionOutputSet
21236  - PLIB_PORTS_DirectionInputSet
21237  - PLIB_PORTS_DirectionOutputSet
21238  - PLIB_PORTS_DirectionGet
21239  Preconditions:
21240  None.
21241  Parameters:
21242  index - Identifier for the device instance
21243  Returns:
21244  - true - The PortsDirection feature is supported on the device
21245  - false - The PortsDirection feature is not supported on the device
21246  Remarks:
21247  None.
21248 */
21249 
21250 bool
21252  PORTS_MODULE_ID index ) ;
21253 //******************************************************************************
21254 /* Function:
21255  PLIB_PORTS_ExistsPortsOpenDrain( PORTS_MODULE_ID index )
21256  Summary:
21257  Identifies whether the PortsOpenDrain feature exists on the Ports module.
21258  Description:
21259  This function identifies whether the PortsOpenDrain feature is available on
21260  the Ports module.
21261  When this function returns true, these functions are supported on the device:
21262  - PLIB_PORTS_PinOpenDrainEnable
21263  - PLIB_PORTS_PinOpenDrainDisable
21264  - PLIB_PORTS_OpenDrainEnable
21265  - PLIB_PORTS_OpenDrainDisable
21266  Preconditions:
21267  None.
21268  Parameters:
21269  index - Identifier for the device instance
21270  Returns:
21271  - true - The PortsOpenDrain feature is supported on the device
21272  - false - The PortsOpenDrain feature is not supported on the device
21273  Remarks:
21274  None.
21275 */
21276 
21277 bool
21279  PORTS_MODULE_ID index ) ;
21280 //******************************************************************************
21281 /* Function:
21282  PLIB_PORTS_ExistsChangeNotice( PORTS_MODULE_ID index )
21283  Summary:
21284  Identifies whether the ChangeNotice feature exists on the Ports module.
21285  Description:
21286  This function identifies whether the ChangeNotice feature is available on the
21287  Ports module.
21288  When this function returns true, these functions are supported on the device:
21289  - PLIB_PORTS_ChangeNoticeEnable
21290  - PLIB_PORTS_ChangeNoticeDisable
21291  Preconditions:
21292  None.
21293  Parameters:
21294  index - Identifier for the device instance
21295  Returns:
21296  - true - The ChangeNotice feature is supported on the device
21297  - false - The ChangeNotice feature is not supported on the device
21298  Remarks:
21299  None.
21300 */
21301 
21302 bool
21304  PORTS_MODULE_ID index ) ;
21305 //******************************************************************************
21306 /* Function:
21307  PLIB_PORTS_ExistsPinChangeNotice( PORTS_MODULE_ID index )
21308  Summary:
21309  Identifies whether the PinChangeNotice feature exists on the Ports module.
21310  Description:
21311  This function identifies whether the PinChangeNotice feature is available on
21312  the Ports module.
21313  When this function returns true, these functions are supported on the device:
21314  - PLIB_PORTS_PinChangeNoticeEnable
21315  - PLIB_PORTS_PinChangeNoticeDisable
21316  - PLIB_PORTS_CnPinsEnable
21317  - PLIB_PORTS_CnPinsDisable
21318  Preconditions:
21319  None.
21320  Parameters:
21321  index - Identifier for the device instance
21322  Returns:
21323  - true - The PinChangeNotice feature is supported on the device
21324  - false - The PinChangeNotice feature is not supported on the device
21325  Remarks:
21326  None.
21327 */
21328 
21329 bool
21331  PORTS_MODULE_ID index ) ;
21332 //******************************************************************************
21333 /* Function:
21334  PLIB_PORTS_ExistsChangeNoticeInIdle( PORTS_MODULE_ID index )
21335  Summary:
21336  Identifies whether the ChangeNoticeInIdle feature exists on the Ports module.
21337  Description:
21338  This function identifies whether the ChangeNoticeInIdle feature is available
21339  on the Ports module.
21340  When this function returns true, these functions are supported on the device:
21341  - PLIB_PORTS_ChangeNoticeInIdleEnable
21342  - PLIB_PORTS_ChangeNoticeInIdleDisable
21343  Preconditions:
21344  None.
21345  Parameters:
21346  index - Identifier for the device instance
21347  Returns:
21348  - true - The ChangeNoticeInIdle feature is supported on the device
21349  - false - The ChangeNoticeInIdle feature is not supported on the device
21350  Remarks:
21351  None.
21352 */
21353 
21354 bool
21356  PORTS_MODULE_ID index ) ;
21357 //******************************************************************************
21358 /* Function:
21359  PLIB_PORTS_ExistsChangeNoticePullUp( PORTS_MODULE_ID index )
21360  Summary:
21361  Identifies whether the ChangeNoticePullup feature exists on the Ports module.
21362  Description:
21363  This function identifies whether the ChangeNoticePullup feature is available
21364  on the Ports module.
21365  When this function returns true, these functions are supported on the device:
21366  - PLIB_PORTS_ChangeNoticePullUpEnable
21367  - PLIB_PORTS_ChangeNoticePullUpDisable
21368  - PLIB_PORTS_CnPinsPullUpEnable
21369  - PLIB_PORTS_CnPinsPullUpDisable
21370  Preconditions:
21371  None.
21372  Parameters:
21373  index - Identifier for the device instance
21374  Returns:
21375  - true - The ChangeNoticePullup feature is supported on the device
21376  - false - The ChangeNoticePullup feature is not supported on the device
21377  Remarks:
21378  None.
21379 */
21380 
21381 bool
21383  PORTS_MODULE_ID index ) ;
21384 //******************************************************************************
21385 /* Function:
21386  PLIB_PORTS_ExistsPinModePerPort( PORTS_MODULE_ID index )
21387  Summary:
21388  Identifies whether the PinModePerPort feature exists on the Ports module.
21389  Description:
21390  This function identifies whether the PinModePerPort (Analog Pin or Digital Pin)
21391  feature is available on the Ports module.
21392  When this function returns true, these functions are supported on the device:
21393  - PLIB_PORTS_PinModePerPortSelect
21394  - PLIB_PORTS_ChannelModeSelect
21395  Preconditions:
21396  None.
21397  Parameters:
21398  index - Identifier for the device instance
21399  Returns:
21400  - true - The PinModePerPort feature is supported on the device
21401  - false - The PinModePerPort feature is not supported on the device
21402  Remarks:
21403  None.
21404 */
21405 
21406 bool
21408  PORTS_MODULE_ID index ) ;
21409 //******************************************************************************
21410 /* Function:
21411  PLIB_PORTS_ExistsChangeNoticePullDownPerPort( PORTS_MODULE_ID index )
21412  Summary:
21413  Identifies whether the ChangeNoticePullDownPerPort feature exists on the
21414  Ports module.
21415  Description:
21416  This function identifies whether the ChangeNoticePullDownPerPort feature is
21417  available on the Ports module.
21418  When this function returns true, these functions are supported on the device:
21419  - PLIB_PORTS_ChangeNoticePullDownPerPortEnable
21420  - PLIB_PORTS_ChangeNoticePullDownPerPortDisable
21421  - PLIB_PORTS_ChannelChangeNoticePullDownEnable
21422  - PLIB_PORTS_ChannelChangeNoticePullDownDisable
21423  Preconditions:
21424  None.
21425  Parameters:
21426  index - Identifier for the device instance
21427  Returns:
21428  - true - The ChangeNoticePullDownPerPort feature is supported on the device
21429  - false - The ChangeNoticePullDownPerPort feature is not supported on the device
21430  Remarks:
21431  None.
21432 */
21433 
21434 bool
21436  PORTS_MODULE_ID index ) ;
21437 //******************************************************************************
21438 /* Function:
21439  PLIB_PORTS_ExistsChangeNoticePullUpPerPort( PORTS_MODULE_ID index )
21440  Summary:
21441  Identifies whether the ChangeNoticePullUpPerPort feature exists on the Ports
21442  module.
21443  Description:
21444  This function identifies whether the ChangeNoticePullUpPerPort feature is available
21445  on the Ports module.
21446  When this function returns true, these functions are supported on the device:
21447  - PLIB_PORTS_ChangeNoticePullUpPerPortEnable
21448  - PLIB_PORTS_ChangeNoticePullUpPerPortDisable
21449  - PLIB_PORTS_ChannelChangeNoticePullUpEnable
21450  - PLIB_PORTS_ChannelChangeNoticePullUpDisable
21451  Preconditions:
21452  None.
21453  Parameters:
21454  index - Identifier for the device instance
21455  Returns:
21456  - true - The ChangeNoticePullUpPerPort feature is supported on the device
21457  - false - The ChangeNoticePullUpPerPort feature is not supported on the device
21458  Remarks:
21459  None.
21460 */
21461 
21462 bool
21464  PORTS_MODULE_ID index ) ;
21465 //******************************************************************************
21466 /* Function:
21467  PLIB_PORTS_ExistsPinChangeNoticePerPort( PORTS_MODULE_ID index )
21468  Summary:
21469  Identifies whether the PinChangeNoticePerPort feature exists on the Ports
21470  module.
21471  Description:
21472  This function identifies whether the PinChangeNoticePerPort feature is
21473  available on the Ports module.
21474  When this function returns true, these functions are supported on the device:
21475  - PLIB_PORTS_PinChangeNoticePerPortEnable
21476  - PLIB_PORTS_PinChangeNoticePerPortDisable
21477  - PLIB_PORTS_ChannelChangeNoticeEnable
21478  - PLIB_PORTS_ChannelChangeNoticeDisable
21479  Preconditions:
21480  None.
21481  Parameters:
21482  index - Identifier for the device instance
21483  Returns:
21484  - true - The PinChangeNoticePerPort feature is supported on the device
21485  - false - The PinChangeNoticePerPort feature is not supported on the device
21486  Remarks:
21487  None.
21488 */
21489 
21490 bool
21492  PORTS_MODULE_ID index ) ;
21493 //******************************************************************************
21494 /* Function:
21495  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn( PORTS_MODULE_ID index )
21496  Summary:
21497  Identifies whether the ChangeNoticePerPortTurnOn feature exists on the Ports
21498  module.
21499  Description:
21500  This function identifies whether the ChangeNoticePerPortTurnOn feature is
21501  available on the Ports module.
21502  When this function returns true, these functions are supported on the device:
21503  - PLIB_PORTS_ChangeNoticePerPortTurnOn
21504  - PLIB_PORTS_ChangeNoticePerPortTurnOff
21505  Preconditions:
21506  None.
21507  Parameters:
21508  index - Identifier for the device instance
21509  Returns:
21510  - true - The ChangeNoticePerPortTurnOn feature is supported on the device
21511  - false - The ChangeNoticePerPortTurnOn feature is not supported on the device
21512  Remarks:
21513  None.
21514 */
21515 
21516 bool
21518  PORTS_MODULE_ID index ) ;
21519 //******************************************************************************
21520 /* Function:
21521  PLIB_PORTS_ExistsChangeNoticePerPortInIdle( PORTS_MODULE_ID index )
21522  Summary:
21523  Identifies whether the ChangeNoticeInIdlePerPort feature exists on the Ports
21524  module.
21525  Description:
21526  This function identifies whether the ChangeNoticeInIdlePerPort feature is
21527  available on the Ports module.
21528  When this function returns true, these functions are supported on the device:
21529  - PLIB_PORTS_ChangeNoticeInIdlePerPortEnable
21530  - PLIB_PORTS_ChangeNoticeInIdlePerPortDisable
21531  Preconditions:
21532  None.
21533  Parameters:
21534  index - Identifier for the device instance
21535  Returns:
21536  - true - The ChangeNoticeInIdlePerPort feature is supported on the device
21537  - false - The ChangeNoticeInIdlePerPort feature is not supported on the device
21538  Remarks:
21539  None.
21540 */
21541 
21542 bool
21544  PORTS_MODULE_ID index ) ;
21545 //******************************************************************************
21546 /* Function:
21547  PLIB_PORTS_ExistsChangeNoticePerPortStatus( PORTS_MODULE_ID index )
21548  Summary:
21549  Identifies whether the ChangeNoticePerPortStatus feature exists on the Ports
21550  module.
21551  Description:
21552  This function identifies whether the ChangeNoticePerPortStatus feature is
21553  available on the Ports module.
21554  When this function returns true, these functions are supported on the device:
21555  - PLIB_PORTS_ChangeNoticePerPortHasOccured
21556  - PLIB_PORTS_ChangeNoticePerPortHasOccurred
21557  Preconditions:
21558  None.
21559  Parameters:
21560  index - Identifier for the device instance
21561  Returns:
21562  - true - The ChangeNoticePerPortStatus feature is supported on the device
21563  - false - The ChangeNoticePerPortStatus feature is not supported on the device
21564  Remarks:
21565  None.
21566 */
21567 
21568 bool
21570  PORTS_MODULE_ID index ) ;
21571 //******************************************************************************
21572 /* Function:
21573  PLIB_PORTS_ExistsSlewRateControl( PORTS_MODULE_ID index )
21574  Summary:
21575  Identifies whether the SlewRateControl feature exists on the Ports module.
21576  Description:
21577  This function identifies whether the SlewRateControl feature is available
21578  on the Ports module.
21579  When this function returns true, these functions are supported on the device:
21580  - PLIB_PORTS_ChannelSlewRateSelect
21581  - PLIB_PORTS_PinSlewRateGet
21582  Preconditions:
21583  None.
21584  Parameters:
21585  index - Identifier for the device instance
21586  Returns:
21587  - true - The SlewRateControl feature is supported on the device
21588  - false - The SlewRateControl feature is not supported on the device
21589  Remarks:
21590  None.
21591 */
21592 
21593 bool
21595  PORTS_MODULE_ID index ) ;
21596 //******************************************************************************
21597 /* Function:
21598  PLIB_PORTS_ExistsChannelChangeNoticeMethod( PORTS_MODULE_ID index )
21599  Summary:
21600  Identifies whether the ChannelChangeNoticeMethod feature exists on the
21601  Ports module.
21602  Description:
21603  This function identifies whether the ChannelChangeNoticeMethod feature is
21604  available on the Ports module.
21605  When this function returns true, these functions are supported on the device:
21606  - PLIB_PORTS_ChannelChangeNoticeMethodSelect
21607  - PLIB_PORTS_ChannelChangeNoticeMethodGet
21608  Preconditions:
21609  None.
21610  Parameters:
21611  index - Identifier for the device instance
21612  Returns:
21613  - true - The ChannelChangeNoticeMethod feature is supported on the device
21614  - false - The ChannelChangeNoticeMethod feature is not supported on the device
21615  Remarks:
21616  None.
21617 */
21618 
21619 bool
21621  PORTS_MODULE_ID index ) ;
21622 //******************************************************************************
21623 /* Function:
21624  PLIB_PORTS_ExistsChangeNoticeEdgeControl( PORTS_MODULE_ID index )
21625  Summary:
21626  Identifies whether the ChangeNoticeEdgeControl feature exists on the Ports
21627  module.
21628  Description:
21629  This function identifies whether the ChangeNoticeEdgeControl feature is
21630  available on the Ports module.
21631  When this function returns true, these functions are supported on the device:
21632  - PLIB_PORTS_ChannelChangeNoticeEdgeEnable
21633  - PLIB_PORTS_ChannelChangeNoticeEdgeDisable
21634  - PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
21635  Preconditions:
21636  None.
21637  Parameters:
21638  index - Identifier for the device instance
21639  Returns:
21640  - true - The ChangeNoticeEdgeControl feature is supported on the device
21641  - false - The ChangeNoticeEdgeControl feature is not supported on the device
21642  Remarks:
21643  None.
21644 */
21645 
21646 bool
21648  PORTS_MODULE_ID index ) ;
21649 //******************************************************************************
21650 /* Function:
21651  PLIB_PORTS_ExistsChangeNoticeEdgeStatus( PORTS_MODULE_ID index )
21652  Summary:
21653  Identifies whether the ChangeNoticeEdgeStatus feature exists on the Ports
21654  module.
21655  Description:
21656  This function identifies whether the ChangeNoticeEdgeStatus feature is available
21657  on the Ports module.
21658  When this function returns true, this function is supported on the device:
21659  - PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
21660  Preconditions:
21661  None.
21662  Parameters:
21663  index - Identifier for the device instance
21664  Returns:
21665  - true - The ChangeNoticeEdgeStatus feature is supported on the device
21666  - false - The ChangeNoticeEdgeStatus feature is not supported on the device
21667  Remarks:
21668  None.
21669 */
21670 
21671 bool
21673  PORTS_MODULE_ID index ) ;
21674 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h */
21675 /*******************************************************************************
21676  Ports Peripheral Library Compatibility Header
21677  Company:
21678  Microchip Technology Inc.
21679  File Name:
21680  plib_ports_compatibility.h
21681  Summary:
21682  Ports Peripheral Library Interface header for backward compatibility.
21683  Description:
21684  This header file contains the definitions of the functions which are
21685  supported for backward compatibility only. These will be deprecated later.
21686 *******************************************************************************/
21687 // DOM-IGNORE-BEGIN
21688 /*******************************************************************************
21689 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
21690 Microchip licenses to you the right to use, modify, copy and distribute
21691 Software only when embedded on a Microchip microcontroller or digital signal
21692 controller that is integrated into your product or third party product
21693 (pursuant to the sublicense terms in the accompanying license agreement).
21694 You should refer to the license agreement accompanying this Software for
21695 additional information regarding your rights and obligations.
21696 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
21697 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
21698 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
21699 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
21700 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
21701 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
21702 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
21703 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
21704 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
21705 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
21706 *******************************************************************************/
21707 // DOM-IGNORE-END
21708 #ifndef _PLIB_PORTS_COMPATIBILITY_H
21709 #define _PLIB_PORTS_COMPATIBILITY_H
21710 #include <stdint.h>
21711 #include <stddef.h>
21712 // *****************************************************************************
21713 /* Function:
21714  bool PLIB_PORTS_ChangeNoticePerPortHasOccured ( PORTS_MODULE_ID index,
21715  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
21716  Summary:
21717  checks the status of change on the pin
21718  Description:
21719  This function checks if the change has occurred on the given pin or not.
21720  Precondition:
21721  None.
21722  Parameters:
21723  index - Identifier for the device instance to be configured
21724  channel - Port pin channel
21725  bitPos - Position in the PORT pins
21726  Returns:
21727  None.
21728  Example:
21729  <code>
21730 
21731  if(PLIB_PORTS_ChangeNoticePerPortHasOccured( PORTS_ID_0,
21732  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
21733  {
21734  //do something
21735  }
21736 
21737  </code>
21738  Remarks:
21739  This feature may not be available on all devices. Please refer to the
21740  specific device data sheet to determine availability or use
21741  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
21742  whether this feature is available.
21743 
21744  This function will be deprecated later.
21745 */
21746 #define PLIB_PORTS_ChangeNoticePerPortHasOccured PLIB_PORTS_ChangeNoticePerPortHasOccurred
21747  // #ifndef _PLIB_PORTS_COMPATIBILITY_H
21748 /*******************************************************************************
21749  End of File
21750 */
21751 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h*/
21752 /* CLOSE_FILE Include File */
21753 
21754 //DOM-IGNORE-BEGIN
21755 //DOM-IGNORE-END
21756  // #ifndef _PLIB_PORTS_H
21757 /*******************************************************************************
21758  End of File
21759 */
21760 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h*/
21761 /* CLOSE_FILE Include File */
21762 
21763 #include "system/int/sys_int.h"
21764 // *****************************************************************************
21765 // *****************************************************************************
21766 // Section: SYS PORTS Data Types
21767 // *****************************************************************************
21768 // *****************************************************************************
21769 // *****************************************************************************
21770 /* SYS PORTS PULLUP status
21771  Summary:
21772  Provides the pull-up and pull-down status.
21773  Description:
21774  These constants provide the pull-up or pull-down status definitions.
21775  Remarks:
21776  None.
21777 */
21778 
21779 typedef
21780  enum
21781  {
21782  /* PULLUP Disable */
21784  /*DOM-IGNORE-BEGIN*/
21785  = 0 /*DOM-IGNORE-END*/
21786  ,
21787  /* PULLUP Enable */
21789  /*DOM-IGNORE-BEGIN*/
21790  = 1 /*DOM-IGNORE-END*/
21791  ,
21793 // *****************************************************************************
21794 /* SYS PORTS PIN DIRECTION
21795  Summary:
21796  Defines the direction of the port pins.
21797  Description:
21798  These constants provide the port pin direction definitions.
21799  Remarks:
21800  None.
21801 */
21802 
21803 typedef
21804  enum
21805  {
21806  /* Direction as output */
21808  /*DOM-IGNORE-BEGIN*/
21809  = 0 /*DOM-IGNORE-END*/
21810  ,
21811  /* Direction as input */
21813  /*DOM-IGNORE-BEGIN*/
21814  = 1 /*DOM-IGNORE-END*/
21815  ,
21817 
21818 typedef
21819  enum
21820  {
21823  // #ifndef _SYS_PORTS_DEFINITIONS_H
21824 /*******************************************************************************
21825  End of File
21826 */
21827 
21828 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h*/
21829 /* CLOSE_FILE Include File */
21830 
21831 // DOM-IGNORE-BEGIN
21832 // DOM-IGNORE-END
21833 // *****************************************************************************
21834 // *****************************************************************************
21835 // Section: SYS PorTS Module Initialization Routine
21836 // *****************************************************************************
21837 // *****************************************************************************
21838 // *****************************************************************************
21839 /* Function:
21840  void SYS_PORTS_Initialize()
21841  Summary:
21842  Initializes PORT Pins/Channels.
21843  <p><b>Implementation:</b> Static/Dynamic</p>
21844  Description:
21845  This function initializes different port pins/channels to the desired state.
21846  It also remaps the pins to the desired specific function.
21847  Precondition:
21848  None.
21849  Parameters:
21850  None.
21851  Returns:
21852  None.
21853  Example:
21854  <code>
21855  SYS_PORTS_Initialize();
21856  </code>
21857  Remarks:
21858  This API must be be called at the time of system initialization to
21859  initialize the ports pins.
21860 */
21861 
21862 void
21864 // *****************************************************************************
21865 // *****************************************************************************
21866 // Section: SYS PORTS CONTROL Routines
21867 // *****************************************************************************
21868 // *****************************************************************************
21869 // *****************************************************************************
21870 /* Function:
21871  PORTS_DATA_TYPE SYS_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
21872  Summary:
21873  Reads the data from the I/O port.
21874  <p><b>Implementation:</b> Dynamic</p>
21875  Description:
21876  This function reads the data from the I/O port.
21877  Preconditions:
21878  The direction of the port to be set as input.
21879  Parameters:
21880  index - Identifier for the device instance to be configured
21881  channel - Identifier for the PORT channel: A, B, C, etc.
21882  Returns:
21883  Returns the data read from the port.
21884  Example:
21885  <code>
21886  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21887  // application developer.
21888  PORTS_DATA_TYPE readData;
21889  readData = SYS_PORTS_Read( MY_PORTS_INSTANCE, MY_CHANNEL );
21890  </code>
21891  Remarks:
21892  None.
21893 */
21894 
21896  SYS_PORTS_Read (
21897  PORTS_MODULE_ID index ,
21898  PORTS_CHANNEL channel ) ;
21899 // *****************************************************************************
21900 /* Function:
21901  void SYS_PORTS_Write( PORTS_MODULE_ID index,
21902  PORTS_CHANNEL channel,
21903  PORTS_DATA_TYPE value )
21904  Summary:
21905  Writes the data to the I/O port.
21906  <p><b>Implementation:</b> Dynamic</p>
21907  Description:
21908  This function writes the data to the I/O port.
21909  Preconditions:
21910  The direction of the port to be set as output.
21911  Parameters:
21912  index - Identifier for the device instance to be configured
21913  channel - Identifier for the PORT channel: A, B, C, etc.
21914  value - Value to be written into a port of width PORTS_DATA_TYPE
21915  Returns:
21916  None.
21917  Example:
21918  <code>
21919  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21920  // application developer.
21921  PORTS_DATA_TYPE writeData;
21922  SYS_PORTS_Write( MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE );
21923  </code>
21924  Remarks:
21925  None.
21926 */
21927 
21928 void
21929  SYS_PORTS_Write (
21930  PORTS_MODULE_ID index ,
21931  PORTS_CHANNEL channel ,
21932  PORTS_DATA_TYPE value ) ;
21933 // *****************************************************************************
21934 /* Function:
21935  PORTS_DATA_TYPE SYS_PORTS_LatchedGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
21936  Summary:
21937  Reads the data driven on the I/O port.
21938  <p><b>Implementation:</b> Dynamic</p>
21939  Description:
21940  This function reads the data driven on the I/O port.
21941  Preconditions:
21942  The direction of the port to be set as output.
21943  Parameters:
21944  index - Identifier for the device instance to be configured
21945  channel - Identifier for the PORT channel: A, B, C, etc.
21946  Returns:
21947  Returns the data driven on the port.
21948  Example:
21949  <code>
21950  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21951  // application developer.
21952  PORTS_DATA_TYPE drivenData;
21953  drivenData = SYS_PORTS_LatchedGet( MY_PORTS_INSTANCE, MY_CHANNEL );
21954  </code>
21955  Remarks:
21956  None.
21957 */
21958 
21961  PORTS_MODULE_ID index ,
21962  PORTS_CHANNEL channel ) ;
21963 // *****************************************************************************
21964 /* Function:
21965  void SYS_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
21966  PORTS_DATA_TYPE value,
21967  PORTS_DATA_MASK mask )
21968  Summary:
21969  Sets the selected digital port/latch based on the mask.
21970  <p><b>Implementation:</b> Dynamic</p>
21971  Description:
21972  This function Sets the selected digital port/latch relative to the mask.
21973  This function "AND" value and mask parameters and then set the bits
21974  in the port channel that were set in the result of the ANDing operation.
21975  Preconditions:
21976  None.
21977  Parameters:
21978  index - Identifier for the device instance to be configured
21979  channel - Identifier for the PORT channel: A, B, C, etc.
21980  value - Consists of information about which port bit has to be set
21981  mask - Identifies the bits which could be intended for setting
21982  Returns:
21983  None.
21984  Example:
21985  <code>
21986  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21987  // application developer.
21988  // MY_VALUE - 0x1234
21989  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
21990  // Set the MY_CHANNEL bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
21991  SYS_PORTS_Set(MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE, myMask);
21992  </code>
21993  Remarks:
21994  Not all features are available on all devices. Refer to the specific device
21995  data sheet for availability.
21996 */
21997 
21998 void
21999  SYS_PORTS_Set (
22000  PORTS_MODULE_ID index ,
22001  PORTS_CHANNEL channel ,
22002  PORTS_DATA_TYPE value ,
22003  PORTS_DATA_MASK mask ) ;
22004 // *****************************************************************************
22005 /* Function:
22006  void SYS_PORTS_Clear ( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22007  PORTS_DATA_MASK clearMask )
22008  Summary:
22009  Clears the selected digital port.
22010  <p><b>Implementation:</b> Dynamic</p>
22011  Description:
22012  This function clears the selected digital port.
22013  Preconditions:
22014  None.
22015  Parameters:
22016  index - Identifier for the device instance to be configured
22017  channel - Identifier for the PORT channel: A, B, C, etc.
22018  clearMask - Identifies the bits to be cleared
22019  Returns:
22020  None.
22021  Example:
22022  <code>
22023  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22024  // application developer.
22025  PORTS_DATA_MASK clearMask = (PORTS_DATA_MASK)0x00FF;
22026  SYS_PORTS_Clear( MY_PORTS_INSTANCE, MY_CHANNEL, clearMask );
22027  </code>
22028  Remarks:
22029  Not all features are available on all devices. Refer to the specific device
22030  data sheet for availability.
22031 */
22032 
22033 void
22034  SYS_PORTS_Clear (
22035  PORTS_MODULE_ID index ,
22036  PORTS_CHANNEL channel ,
22037  PORTS_DATA_MASK clearMask ) ;
22038 // *****************************************************************************
22039 /* Function:
22040  void SYS_PORTS_DirectionSelect( PORTS_MODULE_ID index,
22041  SYS_PORTS_PIN_DIRECTION pinDir,
22042  PORTS_CHANNEL channel,
22043  PORTS_DATA_MASK mask )
22044  Summary:
22045  Enables the direction for the selected port.
22046  <p><b>Implementation:</b> Dynamic</p>
22047  Description:
22048  This function enables the direction for the selected port.
22049  Preconditions:
22050  None.
22051  Parameters:
22052  index - Identifier for the device instance to be configured
22053  pinDir - Pin direction
22054  channel - Identifier for the PORT channel: A, B, C, etc.
22055  mask - Mask for the direction of width PORTS_DATA_MASK
22056  Returns:
22057  None
22058  Example:
22059  <code>
22060  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22061  // application developer.
22062  SYS_PORTS_PIN_DIRECTION pinDir;
22063  pinDir = SYS_PORTS_DIRECTION_INPUT;
22064  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
22065  SYS_PORTS_DirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, myMask );
22066  </code>
22067  Remarks:
22068  None.
22069 */
22070 
22071 void
22073  PORTS_MODULE_ID index ,
22074  SYS_PORTS_PIN_DIRECTION pinDir ,
22075  PORTS_CHANNEL channel ,
22076  PORTS_DATA_MASK mask ) ;
22077 // *****************************************************************************
22078 /* Function:
22079  PORTS_DATA_MASK SYS_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
22080  Summary:
22081  Reads the direction for the selected port.
22082  <p><b>Implementation:</b> Dynamic</p>
22083  Description:
22084  This function reads the direction for the selected port.
22085  Preconditions:
22086  None.
22087  Parameters:
22088  index - Identifier for the device instance to be configured
22089  channel - Identifier for the PORT channel: A, B, C, etc.
22090  Returns:
22091  Direction of the port.
22092  Example:
22093  <code>
22094  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22095  // application developer.
22096  PORTS_DATA_MASK value;
22097  value = SYS_PORTS_DirectionGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22098  </code>
22099  Remarks:
22100  None.
22101 */
22102 
22105  PORTS_MODULE_ID index ,
22106  PORTS_CHANNEL channel ) ;
22107 // *****************************************************************************
22108 /* Function:
22109  void SYS_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22110  PORTS_DATA_MASK toggleMask )
22111  Summary:
22112  Toggles the selected digital port pins.
22113  <p><b>Implementation:</b> Dynamic</p>
22114  Description:
22115  This function toggles the selected digital port pins.
22116  Preconditions:
22117  None.
22118  Parameters:
22119  index - Identifier for the device instance to be configured
22120  channel - Identifier for the PORT channel: A, B, C, etc.
22121  toggleMask - Identifies the bits to be toggled
22122  Returns:
22123  None.
22124  Example:
22125  <code>
22126  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22127  // application developer.
22128  PORTS_DATA_MASK toggleMask = (PORTS_DATA_MASK)0x00FF;
22129  SYS_PORTS_Toggle( MY_PORTS_INSTANCE, MY_CHANNEL, toggleMask );
22130  </code>
22131  Remarks:
22132  None.
22133 */
22134 
22135 void
22137  PORTS_MODULE_ID index ,
22138  PORTS_CHANNEL channel ,
22139  PORTS_DATA_MASK toggleMask ) ;
22140 // *****************************************************************************
22141 /* Function:
22142  void SYS_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22143  PORTS_DATA_MASK mask )
22144  Summary:
22145  Enables the open-drain functionality for the selected port.
22146  <p><b>Implementation:</b> Dynamic</p>
22147  Description:
22148  This function enables the open-drain functionality for the selected port.
22149  Preconditions:
22150  None.
22151  Parameters:
22152  index - Identifier for the device instance to be configured
22153  channel - Identifier for the PORT channel: A, B, C, etc.
22154  mask - Mask of type PORTS_DATA_MASK
22155  Returns:
22156  None.
22157  Example:
22158  <code>
22159  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22160  // application developer.
22161  SYS_PORTS_OpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22162  </code>
22163  Remarks:
22164  Not all features are available on all devices. Refer to the specific device
22165  data sheet for availability.
22166 */
22167 
22168 void
22170  PORTS_MODULE_ID index ,
22171  PORTS_CHANNEL channel ,
22172  PORTS_DATA_MASK mask ) ;
22173 // *****************************************************************************
22174 /* Function:
22175  void SYS_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22176  PORTS_DATA_MASK mask )
22177  Summary:
22178  Disables the open-drain functionality for the selected port.
22179  <p><b>Implementation:</b> Dynamic</p>
22180  Description:
22181  This function disables the open-drain functionality for the selected port.
22182  Preconditions:
22183  None.
22184  Parameters:
22185  index - Identifier for the device instance to be configured
22186  channel - Identifier for the PORT channel: A, B, C, etc.
22187  mask - Mask of type PORTS_DATA_MASK
22188  Returns:
22189  None.
22190  Example:
22191  <code>
22192  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22193  // application developer.
22194  SYS_PORTS_PeripheralOpenDrainDisable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22195  </code>
22196  Remarks:
22197  Not all features are available on all devices. Refer to the specific device
22198  data sheet for availability.
22199 */
22200 
22201 void
22203  PORTS_MODULE_ID index ,
22204  PORTS_CHANNEL channel ,
22205  PORTS_DATA_MASK mask ) ;
22206 // *****************************************************************************
22207 /* Function:
22208  PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet
22209  (
22210  PORTS_MODULE_ID index,
22211  PORTS_CHANNEL channel
22212  )
22213  Summary:
22214  Reads the interrupt status from the I/O port.
22215  <p><b>Implementation:</b> Dynamic</p>
22216  Description:
22217  This function reads the interrupt status from the I/O port.
22218  Preconditions:
22219  The interrupts should have been configured.
22220  Parameters:
22221  index - Identifier for the device instance to be configured
22222  channel - Identifier for the PORT channel: A, B, C, etc.
22223  Returns:
22224  Returns the interrupt status of the port channel.
22225  Example:
22226  <code>
22227  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22228  // application developer.
22229  PORTS_DATA_TYPE channelStatus;
22230  channelStatus = SYS_PORTS_InterruptStatusGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22231  </code>
22232  Remarks:
22233  None.
22234 */
22235 
22238  PORTS_MODULE_ID index ,
22239  PORTS_CHANNEL channel ) ;
22240 // *****************************************************************************
22241 // *****************************************************************************
22242 // Section: SYS PORT PINS REMAPING Routines
22243 // *****************************************************************************
22244 // *****************************************************************************
22245 // *****************************************************************************
22246 /* Function:
22247  void SYS_PORTS_RemapInput( PORTS_MODULE_ID index,
22248  PORTS_REMAP_INPUT_FUNCTION function,
22249  PORTS_REMAP_INPUT_PIN remapPin )
22250  Summary:
22251  Input/Output (I/O) function remapping.
22252  <p><b>Implementation:</b> Dynamic</p>
22253  Description:
22254  This function controls the I/O function remapping.
22255  Precondition:
22256  None.
22257  Parameters:
22258  index - Identifier for the device instance to be configured
22259  function - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
22260  remapPin - One of the possible values of PORTS_REMAP_INPUT_PIN
22261  Returns:
22262  None.
22263  Example:
22264  <code>
22265  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22266  // application developer.
22267  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
22268  SYS_PORTS_RemapInput(MY_PORTS_INSTANCE, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
22269  </code>
22270  Remarks:
22271  This feature may not be available on all devices. Please refer to the
22272  specific device data sheet to determine availability or use
22273  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22274  this feature is available.
22275 */
22276 
22277 void
22279  PORTS_MODULE_ID index ,
22280  PORTS_REMAP_INPUT_FUNCTION function ,
22281  PORTS_REMAP_INPUT_PIN remapPin ) ;
22282 // *****************************************************************************
22283 /* Function:
22284  void SYS_PORTS_RemapOutput( PORTS_MODULE_ID index,
22285  PORTS_REMAP_OUTPUT_FUNCTION function,
22286  PORTS_REMAP_OUTPUT_PIN remapPin )
22287  Summary:
22288  Input/Output (I/O) function remapping.
22289  <p><b>Implementation:</b> Dynamic</p>
22290  Description:
22291  This function controls the I/O function remapping.
22292  Precondition:
22293  None.
22294  Parameters:
22295  index - Identifier for the device instance to be configured
22296  function - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
22297  remapPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
22298  Returns:
22299  None.
22300  Example:
22301  <code>
22302  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22303  // application developer.
22304  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
22305  SYS_PORTS_RemapInputOutput(MY_PORTS_INSTANCE, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
22306  </code>
22307  Remarks:
22308  This feature may not be available on all devices. Please refer to the
22309  specific device data sheet to determine availability or use
22310  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22311  this feature is available.
22312 */
22313 
22314 void
22316  PORTS_MODULE_ID index ,
22317  PORTS_REMAP_OUTPUT_FUNCTION function ,
22318  PORTS_REMAP_OUTPUT_PIN remapPin ) ;
22319 // *****************************************************************************
22320 // *****************************************************************************
22321 // Section: SYS Change Notification Pins Routines
22322 // *****************************************************************************
22323 // *****************************************************************************
22324 // *****************************************************************************
22325 /* Function:
22326  void SYS_PORTS_ChangeNotificationGlobalEnable( PORTS_MODULE_ID index )
22327  Summary:
22328  Globally enables the change notification for the selected port.
22329  <p><b>Implementation:</b> Dynamic</p>
22330  Description:
22331  This function globally enables the change notification for the selected port.
22332  Preconditions:
22333  None.
22334  Parameters:
22335  None.
22336  Returns:
22337  None.
22338  Example:
22339  <code>
22340  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22341  // application developer.
22342  SYS_PORTS_ChangeNotificationGlobalEnable( MY_PORTS_INSTANCE );
22343  </code>
22344  Remarks:
22345  Not all features are available on all devices. Refer to the specific device
22346  data sheet for availability.
22347 */
22348 
22349 void
22351  PORTS_MODULE_ID index ) ;
22352 // *****************************************************************************
22353 /* Function:
22354  void SYS_PORTS_ChangeNotificationGlobalDisable( PORTS_MODULE_ID index );
22355  Summary:
22356  Globally disables the change notification for the selected port.
22357  <p><b>Implementation:</b> Dynamic</p>
22358  Description:
22359  This function globally disables the change notification for the selected port.
22360  Preconditions:
22361  None.
22362  Parameters:
22363  None.
22364  Returns:
22365  None.
22366  Example:
22367  <code>
22368  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22369  // application developer.
22370  SYS_PORTS_ChangeNotificationGlobalDisable( MY_PORTS_INSTANCE);
22371  </code>
22372  Remarks:
22373  Not all features are available on all devices. Refer to the specific device
22374  data sheet for availability.
22375 */
22376 
22377 void
22379  PORTS_MODULE_ID index ) ;
22380 // *****************************************************************************
22381 /* Function:
22382  void SYS_PORTS_ChangeNotificationEnable( PORTS_MODULE_ID index,
22383  PORTS_CHANGE_NOTICE_PIN pinNum,
22384  SYS_PORTS_PULLUP_PULLDOWN_STATUS value )
22385  Summary:
22386  Enables the change notification for the selected port.
22387  <p><b>Implementation:</b> Dynamic</p>
22388  Description:
22389  This function enables the change notification for the selected port.
22390  Preconditions:
22391  None.
22392  Parameters:
22393  index - Identifier for the device instance to be configured
22394  value - Pull-up enable or disable value
22395  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22396  Returns:
22397  None.
22398  Example:
22399  <code>
22400  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22401  // application developer.
22402  SYS_PORTS_PULLUP_PULLDOWN_STATUS value;
22403  PORTS_CHANGE_NOTICE_PIN pinNum;
22404  SYS_PORTS_ChangeNotificationEnable( index, pinNum, value );
22405  </code>
22406  Remarks:
22407  Not all features are available on all devices. Refer to the specific device
22408  data sheet for availability.
22409 */
22410 
22411 void
22413  PORTS_MODULE_ID index ,
22414  PORTS_CHANGE_NOTICE_PIN pinNum ,
22416 // *****************************************************************************
22417 /* Function:
22418  void SYS_PORTS_ChangeNotificationDisable( PORTS_MODULE_ID index,
22419  PORTS_CHANGE_NOTICE_PIN pinNum )
22420  Summary:
22421  Disables the change notification for the selected port.
22422  <p><b>Implementation:</b> Dynamic</p>
22423  Description:
22424  This function disables the change notification for the selected port.
22425  Preconditions:
22426  None.
22427  Parameters:
22428  index - Identifier for the device instance to be configured
22429  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22430  Returns:
22431  None.
22432  Example:
22433  <code>
22434  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22435  // application developer.
22436  PORTS_CHANGE_NOTICE_PIN pinNum;
22437  SYS_PORTS_ChangeNotificationDisable( index, pinNum );
22438  </code>
22439  Remarks:
22440  Not all features are available on all devices. Refer to the specific device
22441  data sheet for availability.
22442 */
22443 
22444 void
22446  PORTS_MODULE_ID index ,
22447  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22448 // *****************************************************************************
22449 /* Function:
22450  void SYS_PORTS_ChangeNotificationInIdleModeEnable( PORTS_MODULE_ID index );
22451  Summary:
22452  Enables the change notification for the selected port in Sleep or Idle mode.
22453  <p><b>Implementation:</b> Dynamic</p>
22454  Description:
22455  This function enables the change notification for the selected port in Sleep
22456  or Idle mode.
22457  Preconditions:
22458  None.
22459  Parameters:
22460  None.
22461  Returns:
22462  None.
22463  Example:
22464  <code>
22465  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22466  // application developer.
22467  SYS_PORTS_ChangeNotificationInIdleModeEnable( MY_PORTS_INSTANCE );
22468  </code>
22469  Remarks:
22470  Not all features are available on all devices. Refer to the specific device
22471  data sheet for availability.
22472 */
22473 
22474 void
22476  PORTS_MODULE_ID index ) ;
22477 // *****************************************************************************
22478 /* Function:
22479  void SYS_PORTS_ChangeNotificationInIdleModeDisable( PORTS_MODULE_ID index);
22480  Summary:
22481  Disables the change notification for the selected port in Sleep or Idle mode.
22482  <p><b>Implementation:</b> Dynamic</p>
22483  Description:
22484  This function disables the change notification for the selected port in Sleep
22485  or Idle mode.
22486  Preconditions:
22487  None.
22488  Parameters:
22489  None.
22490  Returns:
22491  None.
22492  Example:
22493  <code>
22494  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22495  // application developer.
22496  SYS_PORTS_ChangeNotificationInIdleModeDisable( MY_PORTS_INSTANCE );
22497  </code>
22498  Remarks:
22499  Not all features are available on all devices. Refer to the specific device
22500  data sheet for availability.
22501 */
22502 
22503 void
22505  PORTS_MODULE_ID index ) ;
22506 // *****************************************************************************
22507 /* Function:
22508  void SYS_PORTS_ChangeNotificationPullUpEnable ( PORTS_MODULE_ID index,
22509  PORTS_CHANGE_NOTICE_PIN pinNum )
22510  Summary:
22511  Enables a weak pull-up on the change notification pin.
22512  <p><b>Implementation:</b> Dynamic</p>
22513  Description:
22514  This function enables a weak pull-up on the change notification pin.
22515  Preconditions:
22516  None.
22517  Parameters:
22518  index - Identifier for the device instance to be configured
22519  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22520  Returns:
22521  None.
22522  Example:
22523  <code>
22524  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22525  // application developer.
22526  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22527  SYS_PORTS_ChangeNotificationPullUpEnable( MY_PORTS_INSTANCE, MY_PINNUM );
22528  </code>
22529  Remarks:
22530  Not all features are available on all devices. Refer to the specific device
22531  data sheet for availability.
22532 */
22533 
22534 void
22536  PORTS_MODULE_ID index ,
22537  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22538 // *****************************************************************************
22539 /* Function:
22540  void SYS_PORTS_ChangeNotificationPullUpDisable ( PORTS_MODULE_ID index,
22541  PORTS_CHANGE_NOTICE_PIN pinNum )
22542  Summary:
22543  Disables a weak pull-up on the change notification pin.
22544  <p><b>Implementation:</b> Dynamic</p>
22545  Description:
22546  This function Disables a weak pull-up on the change notification pin.
22547  Preconditions:
22548  None.
22549  Parameters:
22550  index - Identifier for the device instance to be configured
22551  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22552  Returns:
22553  None.
22554  Example:
22555  <code>
22556  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22557  // application developer.
22558  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22559  SYS_PORTS_ChangeNotificationPullUpDisable( MY_PORTS_INSTANCE, MY_PINNUM );
22560  </code>
22561  Remarks:
22562  Not all features are available on all devices. Refer to the specific device
22563  data sheet for availability.
22564 */
22565 
22566 void
22568  PORTS_MODULE_ID index ,
22569  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22570 // *****************************************************************************
22571 // *****************************************************************************
22572 // Section: SYS PORT PINS Control Routines
22573 // *****************************************************************************
22574 // *****************************************************************************
22575 // *****************************************************************************
22576 /* Function:
22577  void SYS_PORTS_PinModeSelect ( PORTS_MODULE_ID index,
22578  PORTS_ANALOG_PIN pin,
22579  PORTS_PIN_MODE mode)
22580  Summary:
22581  Enables the selected pin as analog or digital.
22582  <p><b>Implementation:</b> Dynamic</p>
22583  Description:
22584  This function enables the selected pin as analog or digital.
22585  Preconditions:
22586  None.
22587  Parameters:
22588  index - Identifier for the device instance to be configured
22589  pin - Possible values of PORTS_ANALOG_PIN
22590  mode - Possible values of PORTS_PIN_MODE
22591  Returns:
22592  None.
22593  Example:
22594  <code>
22595  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22596  // application developer.
22597  // MY_PIN - PORTS_ANALOG_PIN_AN0
22598  // MY_PIN_MODE - PORTS_PIN_MODE_ANALOG
22599  SYS_PORTS_PinModSYS_PORTS_PinModeSelecteSelect( MY_PORTS_INSTANCE, MY_PIN, MY_PIN_MODE );
22600  </code>
22601  Remarks:
22602  Not all features are available on all devices. Refer to the specific device
22603  data sheet for availability.
22604 */
22605 
22606 void
22608  PORTS_MODULE_ID index ,
22609  PORTS_ANALOG_PIN pin ,
22610  PORTS_PIN_MODE mode ) ;
22611 // *****************************************************************************
22612 /* Function:
22613  void SYS_PORTS_PinWrite ( PORTS_MODULE_ID index,
22614  PORTS_CHANNEL channel,
22615  PORTS_BIT_POS bitPos
22616  bool value )
22617  Summary:
22618  Writes the selected digital pin.
22619  <p><b>Implementation:</b> Dynamic</p>
22620  Description:
22621  This function writes the selected digital pin.
22622  Preconditions:
22623  None.
22624  Parameters:
22625  index - Identifier for the device instance to be configured
22626  channel - Identifier for the PORT channel: A, B, C, etc.
22627  bitPos - Possible values of PORTS_BIT_POS
22628  value - Value to be written to the specific pin/latch:
22629  - true - Sets the bit
22630  - false - Clears the bit
22631  Returns:
22632  None.
22633  Example:
22634  <code>
22635  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22636  // application developer.
22637  // MY_PINNUM - PORTS_PIN_10
22638  SYS_PORTS_PinWrite(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM, value);
22639  </code>
22640  Remarks:
22641  Not all features are available on all devices. Refer to the specific device
22642  data sheet for availability.
22643 */
22644 
22645 void
22647  PORTS_MODULE_ID index ,
22648  PORTS_CHANNEL channel ,
22649  PORTS_BIT_POS bitPos ,
22650  bool value ) ;
22651 // *****************************************************************************
22652 /* Function:
22653  bool SYS_PORTS_PinLatchedGet ( PORTS_MODULE_ID index,
22654  PORTS_CHANNEL channel,
22655  PORTS_BIT_POS bitPos )
22656  Summary:
22657  Reads the data driven on the selected digital pin.
22658  <p><b>Implementation:</b> Dynamic</p>
22659  Description:
22660  This function reads the data driven on the selected
22661  digital output pin.
22662  Preconditions:
22663  None.
22664  Parameters:
22665  index - Identifier for the device instance to be configured
22666  channel - Identifier for the PORT channel: A, B, C, etc.
22667  bitPos - Possible values of PORTS_BIT_POS
22668  Returns:
22669  The status of the data driven on the port pin.
22670  Example:
22671  <code>
22672  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22673  // application developer.
22674  // MY_PINNUM - PORTS_PIN_10
22675  status = SYS_PORTS_PinLatchedGet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22676  </code>
22677  Remarks:
22678  Not all features are available on all devices. Refer to the specific device
22679  data sheet for availability.
22680 */
22681 
22682 bool
22684  PORTS_MODULE_ID index ,
22685  PORTS_CHANNEL channel ,
22686  PORTS_BIT_POS bitPos ) ;
22687 // *****************************************************************************
22688 /* Function:
22689  bool SYS_PORTS_PinRead ( PORTS_MODULE_ID index,
22690  PORTS_CHANNEL channel,
22691  PORTS_BIT_POS bitPos )
22692  Summary:
22693  Reads the selected digital pin.
22694  <p><b>Implementation:</b> Dynamic</p>
22695  Description:
22696  This function reads the selected digital pin, not the Latch.
22697  Preconditions:
22698  None.
22699  Parameters:
22700  index - Identifier for the device instance to be configured
22701  channel - Identifier for the PORT channel: A, B, C, etc.
22702  bitPos - Possible values of PORTS_BIT_POS
22703  Returns:
22704  The status of the port pin.
22705  Example:
22706  <code>
22707  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22708  // application developer.
22709  // MY_PINNUM - PORTS_PIN_10
22710  bool bitStatus = SYS_PORTS_PinRead(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22711  </code>
22712  Remarks:
22713  Not all features are available on all devices. Refer to the specific device
22714  data sheet for availability.
22715 */
22716 
22717 bool
22719  PORTS_MODULE_ID index ,
22720  PORTS_CHANNEL channel ,
22721  PORTS_BIT_POS bitPos ) ;
22722 // *****************************************************************************
22723 /* Function:
22724  void SYS_PORTS_PinToggle ( PORTS_MODULE_ID index,
22725  PORTS_CHANNEL channel,
22726  PORTS_BIT_POS bitPos )
22727  Summary:
22728  Toggles the selected digital pin.
22729  <p><b>Implementation:</b> Dynamic</p>
22730  Description:
22731  This function toggles the selected digital pin.
22732  Preconditions:
22733  None.
22734  Parameters:
22735  index - Identifier for the device instance to be configured
22736  channel - Identifier for the PORT channel: A, B, C, etc.
22737  bitPos - Possible values of PORTS_BIT_POS
22738  Returns:
22739  None.
22740  Example:
22741  <code>
22742  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22743  // application developer.
22744  // MY_PINNUM - PORTS_PIN_10
22745  SYS_PORTS_PinToggle( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22746  </code>
22747  Remarks:
22748  Not all features are available on all devices. Refer to the specific device
22749  data sheet for availability.
22750 */
22751 
22752 void
22754  PORTS_MODULE_ID index ,
22755  PORTS_CHANNEL channel ,
22756  PORTS_BIT_POS bitPos ) ;
22757 // *****************************************************************************
22758 /* Function:
22759  void SYS_PORTS_PinSet( PORTS_MODULE_ID index,
22760  PORTS_CHANNEL channel,
22761  PORTS_BIT_POS bitPos )
22762  Summary:
22763  Sets the selected digital pin/latch.
22764  <p><b>Implementation:</b> Dynamic</p>
22765  Description:
22766  This function sets the selected digital pin/latch.
22767  Preconditions:
22768  None.
22769  Parameters:
22770  index - Identifier for the device instance to be configured
22771  channel - Identifier for the PORT channel: A, B, C, etc.
22772  bitPos - Possible values of PORTS_BIT_POS
22773  Returns:
22774  None.
22775  Example:
22776  <code>
22777  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22778  // application developer.
22779  // MY_PINNUM - PORTS_PIN_10
22780  SYS_PORTS_PinSet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22781  </code>
22782  Remarks:
22783  Not all features are available on all devices. Refer to the specific device
22784  data sheet for availability.
22785 */
22786 
22787 void
22789  PORTS_MODULE_ID index ,
22790  PORTS_CHANNEL channel ,
22791  PORTS_BIT_POS bitPos ) ;
22792 // *****************************************************************************
22793 /* Function:
22794  void SYS_PORTS_PinClear ( PORTS_MODULE_ID index,
22795  PORTS_CHANNEL channel,
22796  PORTS_BIT_POS bitPos )
22797  Summary:
22798  Clears the selected digital pin.
22799  <p><b>Implementation:</b> Dynamic</p>
22800  Description:
22801  This function clears the selected digital pin.
22802  Preconditions:
22803  None.
22804  Parameters:
22805  index - Identifier for the device instance to be configured
22806  channel - Identifier for the PORT channel: A, B, C, etc.
22807  bitPos - Possible values of PORTS_BIT_POS
22808  Returns:
22809  None.
22810  Example:
22811  <code>
22812  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22813  // application developer.
22814  // MY_PINNUM - PORTS_IO_PIN_10
22815  SYS_PORTS_PinClear( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22816  </code>
22817  Remarks:
22818  Not all features are available on all devices. Refer to the specific device
22819  data sheet for availability.
22820 */
22821 
22822 void
22824  PORTS_MODULE_ID index ,
22825  PORTS_CHANNEL channel ,
22826  PORTS_BIT_POS bitPos ) ;
22827 // *****************************************************************************
22828 /* Function:
22829  void SYS_PORTS_PinDirectionSelect ( PORTS_MODULE_ID index,
22830  SYS_PORTS_PIN_DIRECTION pinDir,
22831  PORTS_CHANNEL channel,
22832  PORTS_BIT_POS bitPos )
22833  Summary:
22834  Enables the direction for the selected pin.
22835  <p><b>Implementation:</b> Dynamic</p>
22836  Description:
22837  This function enables the direction for the selected pin.
22838  Preconditions:
22839  None.
22840  Parameters:
22841  index - Identifier for the device instance to be configured
22842  pinDir - Pin direction
22843  channel - Identifier for the PORT channel: A, B, C, etc.
22844  bitPos - Possible values of PORTS_BIT_POS
22845  Returns:
22846  None.
22847  Example:
22848  <code>
22849  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22850  // application developer.
22851  // MY_PINNUM - PORTS_PIN_10
22852  SYS_PORTS_PIN_DIRECTION pinDir;
22853  pinDir = SYS_PORTS_DIRECTION_INPUT;
22854  SYS_PORTS_PinDirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, MY_PINNUM);
22855  </code>
22856  Remarks:
22857  Not all features are available on all devices. Refer to the specific device
22858  data sheet for availability.
22859 */
22860 
22861 void
22863  PORTS_MODULE_ID index ,
22864  SYS_PORTS_PIN_DIRECTION pinDir ,
22865  PORTS_CHANNEL channel ,
22866  PORTS_BIT_POS bitPos ) ;
22867 // *****************************************************************************
22868 /* Function:
22869  void SYS_PORTS_PinOpenDrainEnable ( PORTS_MODULE_ID index,
22870  PORTS_CHANNEL channel,
22871  PORTS_BIT_POS bitPos )
22872  Summary:
22873  Enables the open-drain functionality for the selected pin.
22874  <p><b>Implementation:</b> Dynamic</p>
22875  Description:
22876  This function enables the open-drain functionality for the selected pin.
22877  Preconditions:
22878  None.
22879  Parameters:
22880  index - Identifier for the device instance to be configured
22881  channel - Identifier for the PORT channel: A, B, C, etc.
22882  bitPos - Possible values of PORTS_BIT_POS
22883  Returns:
22884  None.
22885  Example:
22886  <code>
22887  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22888  // application developer.
22889  // MY_PINNUM - PORTS_PIN_10
22890  SYS_PORTS_PinOpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22891  </code>
22892  Remarks:
22893  Not all features are available on all devices. Refer to the specific device
22894  data sheet for availability.
22895 */
22896 
22897 void
22899  PORTS_MODULE_ID index ,
22900  PORTS_CHANNEL channel ,
22901  PORTS_BIT_POS bitPos ) ;
22902 // *****************************************************************************
22903 /* Function:
22904  void SYS_PORTS_PinOpenDrainDisable ( PORTS_MODULE_ID index,
22905  PORTS_CHANNEL channel,
22906  PORTS_BIT_POS bitPos )
22907  Summary:
22908  Disables the open-drain functionality for the selected pin.
22909  <p><b>Implementation:</b> Dynamic</p>
22910  Description:
22911  This function disables the open-drain functionality for the selected pin.
22912  Preconditions:
22913  None.
22914  Parameters:
22915  index - Identifier for the device instance to be configured
22916  channel - Identifier for the PORT channel: A, B, C, etc.
22917  bitPos - Possible values of PORTS_BIT_POS
22918  Returns:
22919  None.
22920  Example:
22921  <code>
22922  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22923  // application developer.
22924  // MY_PINNUM - PORTS_PIN_10
22925  SYS_PORTS_PinOpenDrainDisable(MY_PORTS_INSTANCE, MY_PINNUM);
22926  </code>
22927  Remarks:
22928  Not all features are available on all devices. Refer to the specific device
22929  data sheet for availability.
22930 */
22931 
22932 void
22934  PORTS_MODULE_ID index ,
22935  PORTS_CHANNEL channel ,
22936  PORTS_BIT_POS bitPos ) ;
22937 // *****************************************************************************
22938 /* Function:
22939  void SYS_PORTS_PinPullUpEnable ( PORTS_MODULE_ID index,
22940  PORTS_CHANNEL channel,
22941  PORTS_BIT_POS bitPos )
22942  Summary:
22943  Enables the pull-up functionality for the selected pin.
22944  <p><b>Implementation:</b> Dynamic</p>
22945  Description:
22946  This function enables the pull-up functionality for the selected pin.
22947  Preconditions:
22948  None.
22949  Parameters:
22950  index - Identifier for the device instance to be configured
22951  channel - Identifier for the PORT channel: A, B, C, etc.
22952  bitPos - Possible values of PORTS_BIT_POS
22953  Returns:
22954  None.
22955  Example:
22956  <code>
22957  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22958  // application developer.
22959  // MY_PINNUM - PORTS_PIN_10
22960  SYS_PORTS_PinPullUpEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22961  </code>
22962  Remarks:
22963  Not all features are available on all devices. Refer to the specific device
22964  data sheet for availability.
22965 */
22966 
22967 void
22969  PORTS_MODULE_ID index ,
22970  PORTS_CHANNEL channel ,
22971  PORTS_BIT_POS bitPos ) ;
22972 // *****************************************************************************
22973 /* Function:
22974  void SYS_PORTS_PinPullUpDisable ( PORTS_MODULE_ID index,
22975  PORTS_CHANNEL channel,
22976  PORTS_BIT_POS bitPos )
22977  Summary:
22978  Disables the pull-up functionality for the selected pin.
22979  <p><b>Implementation:</b> Dynamic</p>
22980  Description:
22981  This function disables the pull-up functionality for the selected pin.
22982  Preconditions:
22983  None.
22984  Parameters:
22985  index - Identifier for the device instance to be configured
22986  channel - Identifier for the PORT channel: A, B, C, etc.
22987  bitPos - Possible values of PORTS_BIT_POS
22988  Returns:
22989  None.
22990  Example:
22991  <code>
22992  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22993  // application developer.
22994  // MY_PINNUM - PORTS_PIN_10
22995  SYS_PORTS_PinPullUpDisable(MY_PORTS_INSTANCE, MY_PINNUM);
22996  </code>
22997  Remarks:
22998  Not all features are available on all devices. Refer to the specific device
22999  data sheet for availability.
23000 */
23001 
23002 void
23004  PORTS_MODULE_ID index ,
23005  PORTS_CHANNEL channel ,
23006  PORTS_BIT_POS bitPos ) ;
23007 // *****************************************************************************
23008 /* Function:
23009  void SYS_PORTS_PinPullDownEnable ( PORTS_MODULE_ID index,
23010  PORTS_CHANNEL channel,
23011  PORTS_BIT_POS bitPos )
23012  Summary:
23013  Enables the pull-down functionality for the selected pin.
23014  <p><b>Implementation:</b> Dynamic</p>
23015  Description:
23016  This function enables the pull-down functionality for the selected pin.
23017  Preconditions:
23018  None.
23019  Parameters:
23020  index - Identifier for the device instance to be configured
23021  channel - Identifier for the PORT channel: A, B, C, etc.
23022  bitPos - Possible values of PORTS_BIT_POS
23023  Returns:
23024  None.
23025  Example:
23026  <code>
23027  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23028  // application developer.
23029  // MY_PINNUM - PORTS_PIN_10
23030  SYS_PORTS_PinPullDownEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23031  </code>
23032  Remarks:
23033  Not all features are available on all devices. Refer to the specific device
23034  data sheet for availability.
23035 */
23036 
23037 void
23039  PORTS_MODULE_ID index ,
23040  PORTS_CHANNEL channel ,
23041  PORTS_BIT_POS bitPos ) ;
23042 // *****************************************************************************
23043 /* Function:
23044  void SYS_PORTS_PinPullDownDisable ( PORTS_MODULE_ID index,
23045  PORTS_CHANNEL channel,
23046  PORTS_BIT_POS bitPos )
23047  Summary:
23048  Disables the pull-down functionality for the selected pin.
23049  <p><b>Implementation:</b> Dynamic</p>
23050  Description:
23051  This function disables the pull-down functionality for the selected pin.
23052  Preconditions:
23053  None.
23054  Parameters:
23055  index - Identifier for the device instance to be configured
23056  channel - Identifier for the PORT channel: A, B, C, etc.
23057  bitPos - Possible values of PORTS_BIT_POS
23058  Returns:
23059  None.
23060  Example:
23061  <code>
23062  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23063  // application developer.
23064  // MY_PINNUM - PORTS_PIN_10
23065  SYS_PORTS_PinPullDownDisable(MY_PORTS_INSTANCE, MY_PINNUM);
23066  </code>
23067  Remarks:
23068  Not all features are available on all devices. Refer to the specific device
23069  data sheet for availability.
23070 */
23071 
23072 void
23074  PORTS_MODULE_ID index ,
23075  PORTS_CHANNEL channel ,
23076  PORTS_BIT_POS bitPos ) ;
23077 //******************************************************************************
23078 /* Function:
23079  void SYS_PORTS_InterruptEnable
23080  (
23081  PORTS_MODULE_ID index,
23082  PORTS_CHANNEL channel,
23083  PORTS_BIT_POS bitPos,
23084  PORTS_PIN_INTERRUPT_TYPE pinInterruptType
23085  )
23086  Summary:
23087  Enables the selected interrupt for the selected port pin.
23088  Description:
23089  This function enables the selected interrupt for the selected port pin.
23090  Preconditions:
23091  Select the pull-up or pull-down as required.
23092  Parameters:
23093  index - Identifier for the device instance to be configured
23094  channel - Identifier for the PORT channel: A, B, C, etc.
23095  bitPos - Possible values of PORTS_BIT_POS
23096  pinInterruptType - Interrupt type from PORTS_PIN_INTERRUPT_TYPE set
23097  Returns:
23098  None.
23099  Example:
23100  <code>
23101  SYS_PORTS_InterruptEnable(MY_PORTS_INSTANCE, MY_PORTS_CHANNEL, MY_PORT_BIT_POS, PORTS_PIN_INTERRUPT_BOTH_EDGE );
23102  </code>
23103  Remarks:
23104  None.
23105 */
23106 
23107 void
23109  PORTS_MODULE_ID index ,
23110  PORTS_CHANNEL channel ,
23111  PORTS_BIT_POS bitPos ,
23112  PORTS_PIN_INTERRUPT_TYPE pinInterruptType ) ;
23113 //DOM-IGNORE-BEGIN
23114 //DOM-IGNORE-END
23115  //SYS_PORTS_H
23116 /*******************************************************************************
23117  End of File
23118 */
23119 
23120 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h*/
23121 /* CLOSE_FILE Include File */
23122 
23123 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h */
23124 /*******************************************************************************
23125  SPI Driver Interface
23126  Company:
23127  Microchip Technology Inc.
23128  File Name:
23129  drv_spi.h
23130  Summary:
23131  SPI device driver interface file.
23132  Description:
23133  The SPI driver provides a simple interface to manage the SPI module.
23134  This file defines the interface definitions and prototypes for the SPI driver.
23135 *******************************************************************************/
23136 //DOM-IGNORE-BEGIN
23137 /*******************************************************************************
23138 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
23139 Microchip licenses to you the right to use, modify, copy and distribute
23140 Software only when embedded on a Microchip microcontroller or digital signal
23141 controller that is integrated into your product or third party product
23142 (pursuant to the sublicense terms in the accompanying license agreement).
23143 You should refer to the license agreement accompanying this Software for
23144 additional information regarding your rights and obligations.
23145 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23146 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23147 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23148 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23149 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23150 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23151 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23152 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23153 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23154 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23155 *******************************************************************************/
23156 //DOM-IGNORE-END
23157 #ifndef _DRV_SPI_H
23158 #define _DRV_SPI_H
23159 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h */
23160 /*******************************************************************************
23161  SPI Driver Interface
23162  Company:
23163  Microchip Technology Inc.
23164  File Name:
23165  drv_spi_definitions.h
23166  Summary:
23167  SPI device driver interface file.
23168  Description:
23169  The SPI driver provides a simple interface to manage the SPI module.
23170  This file defines the interface definitions and prototypes for the SPI
23171  driver.
23172 *******************************************************************************/
23173 //DOM-IGNORE-BEGIN
23174 /*******************************************************************************
23175 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
23176 Microchip licenses to you the right to use, modify, copy and distribute
23177 Software only when embedded on a Microchip microcontroller or digital signal
23178 controller that is integrated into your product or third party product
23179 (pursuant to the sublicense terms in the accompanying license agreement).
23180 You should refer to the license agreement accompanying this Software for
23181 additional information regarding your rights and obligations.
23182 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23183 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23184 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23185 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23186 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23187 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23188 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23189 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23190 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23191 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23192 *******************************************************************************/
23193 //DOM-IGNORE-END
23194 #ifndef _DRV_SPI_DEFINITIONS_H
23195 #define _DRV_SPI_DEFINITIONS_H
23196 // *****************************************************************************
23197 // *****************************************************************************
23198 // Section: Data Types
23199 // *****************************************************************************
23200 // *****************************************************************************
23201 #include <stdint.h>
23202 #include <stdbool.h>
23203 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
23204 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" // Common Driver Definitions /* LDRA full path */
23205 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h */
23206 /*******************************************************************************
23207  SPI Peripheral Library Interface Header
23208  Company:
23209  Microchip Technology Inc.
23210  File Name:
23211  plib_spi.h
23212  Summary:
23213  SPI Peripheral Library Interface Header for common definitions.
23214  Description:
23215  This header file contains the function prototypes and definitions of
23216  the data types and constants that make up the interface to the SPI
23217  PLIB.
23218  *******************************************************************************/
23219 // DOM-IGNORE-BEGIN
23220 /*******************************************************************************
23221 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
23222 Microchip licenses to you the right to use, modify, copy and distribute
23223 Software only when embedded on a Microchip microcontroller or digital signal
23224 controller that is integrated into your product or third party product
23225 (pursuant to the sublicense terms in the accompanying license agreement).
23226 You should refer to the license agreement accompanying this Software for
23227 additional information regarding your rights and obligations.
23228 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23229 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23230 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23231 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23232 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23233 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23234 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23235 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23236 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23237 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23238  *******************************************************************************/
23239 // DOM-IGNORE-END
23240 #ifndef _PLIB_SPI_H
23241 #define _PLIB_SPI_H
23242 // DOM-IGNORE-BEGIN
23243 // DOM-IGNORE-END
23244 // *****************************************************************************
23245 // *****************************************************************************
23246 // Section: Included Files (continued at end of file)
23247 // *****************************************************************************
23248 // *****************************************************************************
23249 /* This section lists the other files that are included in this file. However,
23250  please see the end of the file for additional implementation header files
23251  that are also included.
23252  */
23253 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h */
23254 //DOM-IGNORE-BEGIN
23255 /*******************************************************************************
23256 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
23257 Microchip licenses to you the right to use, modify, copy and distribute
23258 Software only when embedded on a Microchip microcontroller or digital signal
23259 controller that is integrated into your product or third party product
23260 (pursuant to the sublicense terms in the accompanying license agreement).
23261 You should refer to the license agreement accompanying this Software for
23262 additional information regarding your rights and obligations.
23263 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
23264 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23265 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23266 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23267 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23268 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23269 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23270 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23271 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23272 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23273  *******************************************************************************/
23274 //DOM-IGNORE-END
23275 #ifndef _PLIB_SPI_PROCESSOR_H
23276 #define _PLIB_SPI_PROCESSOR_H
23277 #error "Can't find header"
23278 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h*/
23279 /* CLOSE_FILE Include File */
23280 
23281 // *****************************************************************************
23282 // *****************************************************************************
23283 // Section: Constants & Data Types
23284 // *****************************************************************************
23285 // *****************************************************************************
23286 // *****************************************************************************
23287 // *****************************************************************************
23288 // Section: SPI Peripheral Library Interface Routines
23289 // *****************************************************************************
23290 // *****************************************************************************
23291 //******************************************************************************
23292 /* Function:
23293  void PLIB_SPI_Enable( SPI_MODULE_ID index )
23294  Summary:
23295  Enables the SPI module.
23296  Description:
23297  This function enables the SPI module.
23298  This operation is atomic.
23299  Precondition:
23300  None.
23301  Parameters:
23302  index - Identifier for the device instance to be configured
23303  Returns:
23304  None.
23305  Example:
23306  <code>
23307  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23308  // application developer.
23309  PLIB_SPI_Enable(MY_SPI_INSTANCE);
23310  </code>
23311  Remarks:
23312  The SCKx, SDOx, SDIx and SSx pins must be assigned to available RPn pins
23313  before use.
23314  This function implements an operation of the enable control feature. This
23315  feature may not be available on all devices. Please refer to the specific
23316  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23317  in your application to automatically determine whether this feature is available.
23318  */
23319 
23320 void
23321  PLIB_SPI_Enable (
23322  SPI_MODULE_ID index ) ;
23323 //******************************************************************************
23324 /* Function:
23325  void PLIB_SPI_Disable (SPI_MODULE_ID index)
23326  Summary:
23327  Disables the SPI module.
23328  Description:
23329  This function disables the SPI module.
23330  This operation is atomic.
23331  Precondition:
23332  None.
23333  Parameters:
23334  index - Identifier for the device instance to be configured
23335  Returns:
23336  None.
23337  Example:
23338  <code>
23339  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23340  // application developer.
23341  PLIB_SPI_Disable(MY_SPI_INSTANCE);
23342  </code>
23343  Remarks:
23344  This function implements an operation of the enable control feature. This
23345  feature may not be available on all devices. Please refer to the specific
23346  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23347  in your application to automatically determine whether this feature is available.
23348  */
23349 
23350 void
23352  SPI_MODULE_ID index ) ;
23353 //******************************************************************************
23354 /* Function:
23355  void PLIB_SPI_StopInIdleEnable (SPI_MODULE_ID index)
23356  Summary:
23357  Discontinues module operation when the device enters Idle mode.
23358  Description:
23359  This function sets up the SPI module such that module operation is disabled
23360  when the device enters Idle mode.
23361  This operation is atomic.
23362  Precondition:
23363  None.
23364  Parameters:
23365  index - Identifier for the device instance to be configured
23366  Returns:
23367  None.
23368  Example:
23369  <code>
23370  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23371  // application developer.
23372  PLIB_SPI_StopInIdleEnable(MY_SPI_INSTANCE);
23373  </code>
23374  Remarks:
23375  This function implements an operation of the stop in idle control feature.
23376  This feature may not be available on all devices. Please refer to the
23377  specific device data sheet to determine availability or use
23378  "PLIB_SPI_ExistsStopInIdleControl" in your application to automatically
23379  determine if this feature is available.
23380  */
23381 
23382 void
23384  SPI_MODULE_ID index ) ;
23385 //******************************************************************************
23386 /* Function:
23387  void PLIB_SPI_StopInIdleDisable (SPI_MODULE_ID index)
23388  Summary:
23389  Continues module operation when the device enters Idle mode.
23390  Description:
23391  This function sets up the SPI module such that module operation is continued
23392  when the device enters Idle mode.
23393  This operation is atomic.
23394  Precondition:
23395  None.
23396  Parameters:
23397  index - Identifier for the device instance to be configured
23398  Returns:
23399  None.
23400  Example:
23401  <code>
23402  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23403  // application developer.
23404  PLIB_SPI_StopInIdleDisable(MY_SPI_INSTANCE);
23405  </code>
23406  Remarks:
23407  This function implements an operation of the stop in idle control feature.
23408  This feature may not be available on all devices. Please refer to the
23409  specific device data sheet to determine availability or use
23410  "PLIB_SPI_ExistsStopInIdleControl" in your application to determine whether
23411  this feature is available.
23412  */
23413 
23414 void
23416  SPI_MODULE_ID index ) ;
23417 //******************************************************************************
23418 /* Function:
23419  bool PLIB_SPI_ReceiverHasOverflowed (SPI_MODULE_ID index)
23420  Summary:
23421  Returns the current status of the SPI receiver overflow.
23422  Description:
23423  This function returns the current status of the SPI receiver overflow.
23424  This operation is atomic.
23425  Precondition:
23426  None.
23427  Parameters:
23428  index - Identifier for the device instance to be configured
23429  Returns:
23430  SPI receiver overflow status:
23431  - true - A new byte/word is completely received and discarded.
23432  The user software has not read the previous data in
23433  the SPI buffer register.
23434  - false - No Overflow has occurred
23435  Example:
23436  <code>
23437  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23438  // application developer.
23439  bool overflowstate = PLIB_SPI_ReceiverHasOverflowed(MY_SPI_INSTANCE);
23440  </code>
23441  Remarks:
23442  This function implements an operation of the receiver overflow status feature.
23443  This feature may not be available on all devices. Please refer to the
23444  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23445  in your application to automatically determine whether this feature is available.
23446  */
23447 
23448 bool
23450  SPI_MODULE_ID index ) ;
23451 //******************************************************************************
23452 /* Function:
23453  void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
23454  Summary:
23455  Clears the SPI receive overflow flag.
23456  Description:
23457  This function clears the SPI receive overflow flag.
23458  This operation is atomic.
23459  Precondition:
23460  None.
23461  Parameters:
23462  index - Identifier for the device instance to be configured
23463  Returns:
23464  None.
23465  Example:
23466  <code>
23467  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23468  // application developer.
23469  PLIB_SPI_ReceiverOverflowClear(MY_SPI_INSTANCE);
23470  </code>
23471  Remarks:
23472  This function implements an operation of the receiver overflow status feature.
23473  This feature may not be available on all devices. Please refer to the
23474  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23475  in your application to automatically determine whether this feature is available.
23476  */
23477 
23478 void
23480  SPI_MODULE_ID index ) ;
23481 //******************************************************************************
23482 /* Function:
23483  bool PLIB_SPI_TransmitBufferIsFull (SPI_MODULE_ID index)
23484  Summary:
23485  Returns the current transmit buffer status of the SPI module.
23486  Description:
23487  This function returns the current transmit buffer status of the SPI module.
23488  This operation is atomic.
23489  Precondition:
23490  None.
23491  Parameters:
23492  index - Identifier for the device instance to be configured
23493  Returns:
23494  - true - Transmit not yet started, transmit buffer is full
23495  - false - Transmit started, transmit buffer is empty/not full
23496  Example:
23497  <code>
23498  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23499  // application developer.
23500  bool buffullstate = PLIB_SPI_TransmitBufferIsFull (MY_SPI_INSTANCE);
23501  </code>
23502  Remarks:
23503  In Standard Buffer mode - automatically set in hardware when SPI buffer writes
23504  occur, loading the transmit buffer. Automatically cleared in hardware when
23505  the SPI module transfers data from the transmit buffer to the shift register.
23506  In Enhanced Buffer mode - automatically set in hardware when SPI buffer writes
23507  occur, loading the last available buffer. Automatically cleared in hardware
23508  when the buffer is available for writing.
23509  This function implements an operation of the transmit buffer status feature.
23510  This feature may not be available on all devices. Please refer to the
23511  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferFullStatus"
23512  in your application to automatically determine whether this feature is available.
23513  */
23514 
23515 bool
23517  SPI_MODULE_ID index ) ;
23518 //******************************************************************************
23519 /* Function:
23520  bool PLIB_SPI_ReceiverBufferIsFull (SPI_MODULE_ID index)
23521  Summary:
23522  Returns the current status of the SPI receive buffer.
23523  Description:
23524  This function returns the current status of the SPI receive buffer.
23525  This operation is atomic.
23526  Precondition:
23527  None.
23528  Parameters:
23529  index - Identifier for the device instance to be configured
23530  Returns:
23531  Receiver Buffer Full Status:
23532  - true - Receive complete, receive buffer is full
23533  - false - Receive is not complete, receive buffer is empty
23534  Example:
23535  <code>
23536  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23537  // application developer.
23538  bool receivefullstate = PLIB_SPI_ReceiverBufferIsFull (MY_SPI_INSTANCE);
23539  </code>
23540  Remarks:
23541  In Standard Buffer mode - automatically set in hardware when the SPI module
23542  transfers data from the shift register to the receive buffer. Automatically
23543  cleared in hardware when the core reads the SPI buffer, read in the receive buffer.
23544  In Enhanced Buffer mode - automatically set in hardware when the SPI module
23545  transfers data from the shift register to the receive buffer, filling the
23546  last unread buffer. Automatically cleared in hardware when a buffer is available
23547  for a transfer from the shift register.
23548  This function implements an operation of the receiver buffer status feature.
23549  This feature may not be available on all devices. Please refer to the
23550  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveBufferStatus"
23551  in your application to automatically determine whether this feature is available.
23552  */
23553 
23554 bool
23556  SPI_MODULE_ID index ) ;
23557 //******************************************************************************
23558 /* Function:
23559  void PLIB_SPI_PinEnable (SPI_MODULE_ID index,SPI_PIN pin)
23560  Summary:
23561  Enables the selected SPI pins.
23562  Description:
23563  This function enables the selected SPI pins.
23564  Precondition:
23565  None.
23566  Parameters:
23567  index - Identifier for the device instance to be configured
23568  pin - One of the SPI_PIN enumeration values as the SPI pin
23569  Returns:
23570  None.
23571  Example:
23572  <code>
23573  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23574  // application developer.
23575  PLIB_SPI_PinEnable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
23576  </code>
23577  Remarks:
23578  This function implements an operation of the pin control feature.
23579  This feature may not be available on all devices. Please refer to the
23580  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
23581  in your application to automatically determine whether this feature is available.
23582  */
23583 
23584 void
23586  SPI_MODULE_ID index ,
23587  SPI_PIN pin ) ;
23588 //******************************************************************************
23589 /* Function:
23590  void PLIB_SPI_PinDisable (SPI_MODULE_ID index, SPI_PIN pin)
23591  Summary:
23592  Enables the selected SPI pins.
23593  Description:
23594  This function enables the selected SPI pins.
23595  Precondition:
23596  None.
23597  Parameters:
23598  index - Identifier for the device instance to be configured
23599  pin - One of the SPI_PIN enumeration values as the SPI pin
23600  Returns:
23601  None.
23602  Example:
23603  <code>
23604  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23605  // application developer.
23606  PLIB_SPI_PinDisable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
23607  </code>
23608  Remarks:
23609  This function implements an operation of the pin control feature.
23610  This feature may not be available on all devices. Please refer to the
23611  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
23612  in your application to automatically determine whether this feature is available.
23613  */
23614 
23615 void
23617  SPI_MODULE_ID index ,
23618  SPI_PIN pin ) ;
23619 //******************************************************************************
23620 /* Function:
23621  void PLIB_SPI_CommunicationWidthSelect (SPI_MODULE_ID index,
23622  SPI_COMMUNICATION_WIDTH width )
23623  Summary:
23624  Selects the data width for the SPI communication.
23625  Description:
23626  This function selects the data width for the SPI communication.
23627  This operation is atomic.
23628  Precondition:
23629  None.
23630  Parameters:
23631  index - Identifier for the device instance to be configured
23632  width - One of the SPI_COMMUNICATION_WIDTH enumeration values as the
23633  SPI buffer width
23634  Returns:
23635  None.
23636  Example:
23637  <code>
23638  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23639  // application developer.
23640  PLIB_SPI_CommunicationWidthSelect(MY_SPI_INSTANCE, SPI_COMMUNICATION_WIDTH_8BITS);
23641  </code>
23642  Remarks:
23643  This function implements an operation of the communication width feature.
23644  This feature may not be available on all devices. Please refer to the
23645  specific device data sheet to determine availability or use "PLIB_SPI_ExistsCommunicationWidth"
23646  in your application to automatically determine whether this feature is available.
23647  */
23648 
23649 void
23651  SPI_MODULE_ID index ,
23652  SPI_COMMUNICATION_WIDTH width ) ;
23653 //******************************************************************************
23654 /* Function:
23655  void PLIB_SPI_AudioCommunicationWidthSelect (SPI_MODULE_ID index,
23656  SPI_AUDIO_COMMUNICATION_WIDTH width )
23657  Summary:
23658  Selects the data width for the SPI audio communication.
23659  Description:
23660  This function selects the data width for the SPI audio communication.
23661  This operation is atomic.
23662  Precondition:
23663  None.
23664  Parameters:
23665  index - Identifier for the device instance to be configured
23666  width - One of the SPI_AUDIO_COMMUNICATION_WIDTH enumeration values as the
23667  SPI buffer width
23668  Returns:
23669  None.
23670  Example:
23671  <code>
23672  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23673  // application developer.
23674  PLIB_SPI_AudioCommunicationWidthSelect(MY_SPI_INSTANCE,
23675  SPI_AUDIO_COMMUNICATION_32DATA_32FIFO_32CHANNEL);
23676  </code>
23677  Remarks:
23678  This mode is available only when PLIB_SPI_AudioProtocolEnable is enabled.
23679  This function implements an operation of the audio communication width feature.
23680  This feature may not be available on all devices. Please refer to the
23681  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioCommunicationWidth"
23682  in your application to automatically determine whether this feature is available.
23683  */
23684 
23685 void
23687  SPI_MODULE_ID index ,
23688  SPI_AUDIO_COMMUNICATION_WIDTH mode ) ;
23689 //******************************************************************************
23690 /* Function:
23691  void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index,
23692  SPI_INPUT_SAMPLING_PHASE phase)
23693  Summary:
23694  Selects the SPI data input sample phase.
23695  Description:
23696  This function selects the input sampling phase in Master mode.
23697  Precondition:
23698  None.
23699  Parameters:
23700  index - Identifier for the device instance to be configured
23701  phase - One of the SPI_INPUT_SAMPLING_PHASE as the SPI input
23702  sampling phase
23703  Returns:
23704  None.
23705  Example:
23706  <code>
23707  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23708  // application developer.
23709  PLIB_SPI_InputSamplePhaseSelect(MY_SPI_INSTANCE, SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE);
23710  </code>
23711  Remarks:
23712  This function implements an operation of the input sample phase feature.
23713  This feature may not be available on all devices. Please refer to the
23714  specific device data sheet to determine availability or use "PLIB_SPI_ExistsInputSamplePhase"
23715  in your application to automatically determine whether this feature is available.
23716  */
23717 
23718 void
23720  SPI_MODULE_ID index ,
23721  SPI_INPUT_SAMPLING_PHASE phase ) ;
23722 //******************************************************************************
23723 /* Function:
23724  void PLIB_SPI_OutputDataPhaseSelect (SPI_MODULE_ID index,
23725  SPI_OUTPUT_DATA_PHASE data)
23726  Summary:
23727  Selects serial output data change.
23728  Description:
23729  This function selects serial output data change.
23730  Precondition:
23731  None.
23732  Parameters:
23733  index - Identifier for the device instance to be configured
23734  data - One of the SPI_OUTPUT_DATA_PHASE enumeration values as the
23735  SPI serial output data change
23736  Returns:
23737  None.
23738  Example:
23739  <code>
23740  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23741  // application developer.
23742  PLIB_SPI_OutputDataPhaseSelect(MY_SPI_INSTANCE, SPI_OUTPUT_DATA_PHASE_ON_ACTIVE_TO_IDLE_CLOCK);
23743  </code>
23744  Remarks:
23745  This function implements an operation of the output data phase feature.
23746  This feature may not be available on all devices. Please refer to the
23747  specific device data sheet to determine availability or use "PLIB_SPI_ExistsOutputDataPhase"
23748  in your application to automatically determine whether this feature is available.
23749  */
23750 
23751 void
23753  SPI_MODULE_ID index ,
23754  SPI_OUTPUT_DATA_PHASE phase ) ;
23755 //******************************************************************************
23756 /* Function:
23757  void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index,
23758  SPI_CLOCK_POLARITY polarity)
23759  Summary:
23760  Enables clock polarity.
23761  Description:
23762  This function enables clock polarity.
23763  Precondition:
23764  None.
23765  Parameters:
23766  index - Identifier for the device instance to be configured
23767  polarity - One of the SPI_CLOCK_POLARITY enumeration values as the SPI clock polarity
23768  Returns:
23769  None.
23770  Example:
23771  <code>
23772  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23773  // application developer.
23774  PLIB_SPI_ClockPolaritySelect(MY_SPI_INSTANCE, SPI_CLOCK_POLARITY_IDLE_HIGH );
23775  </code>
23776  Remarks:
23777  This function implements an operation of the clock polarity feature.
23778  This feature may not be available on all devices. Please refer to the
23779  specific device data sheet to determine availability or use "PLIB_SPI_ExistsClockPolarity"
23780  in your application to automatically determine whether this feature is available.
23781  */
23782 
23783 void
23785  SPI_MODULE_ID index ,
23786  SPI_CLOCK_POLARITY polarity ) ;
23787 //******************************************************************************
23788 /* Function:
23789  void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
23790  Summary:
23791  Enables the SPI in Master mode.
23792  Description:
23793  This function enables the SPI in Master mode.
23794  This operation is atomic.
23795  Precondition:
23796  None.
23797  Parameters:
23798  index - Identifier for the device instance to be configured
23799  Returns:
23800  None.
23801  Example:
23802  <code>
23803  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23804  // application developer.
23805  PLIB_SPI_MasterEnable(MY_SPI_INSTANCE);
23806  </code>
23807  Remarks:
23808  This function implements an operation of the master enable control feature.
23809  This feature may not be available on all devices. Please refer to the
23810  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
23811  in your application to automatically determine whether this feature is available.
23812  */
23813 
23814 void
23816  SPI_MODULE_ID index ) ;
23817 //******************************************************************************
23818 /* Function:
23819  void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
23820  Summary:
23821  Enables the SPI in Slave mode.
23822  Description:
23823  This function enables the SPI in Slave mode.
23824  This operation is atomic.
23825  Precondition:
23826  None.
23827  Parameters:
23828  index - Identifier for the device instance to be configured
23829  Returns:
23830  None.
23831  Example:
23832  <code>
23833  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23834  // application developer.
23835  PLIB_SPI_SlaveEnable(MY_SPI_INSTANCE);
23836  </code>
23837  Remarks:
23838  This function implements an operation of the master enable control feature.
23839  This feature may not be available on all devices. Please refer to the
23840  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
23841  in your application to automatically determine whether this feature is available.
23842  */
23843 
23844 void
23846  SPI_MODULE_ID index ) ;
23847 //******************************************************************************
23848 /* Function:
23849  void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency,
23850  uint32_t baudRate )
23851  Summary:
23852  Sets the baud rate to the desired value.
23853  Description:
23854  This function sets the baud rate to the desired value.
23855  Precondition:
23856  None.
23857  Parameters:
23858  index - Identifier for the device instance to be configured
23859  clockFrequency - Clock frequency
23860  baudrate - Baud rate value
23861  Returns:
23862  None.
23863  Example:
23864  <code>
23865  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23866  // application developer.
23867  PLIB_SPI_BaudRateSet(MY_SPI_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
23868  </code>
23869  Remarks:
23870  Setting a new baud rate value causes the baud rate timer to reset.
23871  This ensures that the baud rate timer does not have to overflow before
23872  outputting the new baud rate.
23873  If the system clock is changed during an active receive operation, a
23874  receive error or data loss may result. To avoid this issue, verify that
23875  no receptions are in progress before changing the system clock.
23876  This function implements an operation of the baud rate set feature.
23877  This feature may not be available on all devices. Please refer to the
23878  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRate"
23879  in your application to automatically determine whether this feature is available.
23880  */
23881 
23882 void
23884  SPI_MODULE_ID index ,
23885  uint32_t clockFrequency ,
23886  uint32_t baudRate ) ;
23887 //******************************************************************************
23888 /* Function:
23889  bool PLIB_SPI_IsBusy (SPI_MODULE_ID index)
23890  Summary:
23891  Returns the current SPI module activity status.
23892  Description:
23893  This function returns the current SPI module activity status.
23894  This operation is atomic.
23895  Precondition:
23896  None.
23897  Parameters:
23898  index - Identifier for the device instance to be configured
23899  Returns:
23900  - true - SPI module is currently busy with some transactions
23901  - false - SPI module is currently idle
23902  Example:
23903  <code>
23904  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23905  // application developer.
23906  bool status = PLIB_SPI_IsBusy(MY_SPI_INSTANCE);
23907  </code>
23908  Remarks:
23909  This function implements an operation of the bus status feature.
23910  This feature may not be available on all devices. Please refer to the
23911  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBusStatus"
23912  in your application to automatically determine whether this feature is available.
23913  */
23914 
23915 bool
23916  PLIB_SPI_IsBusy (
23917  SPI_MODULE_ID index ) ;
23918 //******************************************************************************
23919 /* Function:
23920  bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
23921  Summary:
23922  Returns the current status of the receive (RX) FIFO sign-extended data.
23923  Description:
23924  This function returns the current status of the receive (RX) FIFO
23925  sign-extended data.
23926  This operation is atomic.
23927  Precondition:
23928  None.
23929  Parameters:
23930  index - Identifier for the device instance to be configured
23931  Returns:
23932  - true - Data from RX FIFO is sign-extended
23933  - false - Data from RX FIFO is not sign-extended
23934  Example:
23935  <code>
23936  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23937  // application developer.
23938  bool Status = PLIB_SPI_ReadDataIsSignExtended(MY_SPI_INSTANCE);
23939  </code>
23940  Remarks:
23941  This function implements an operation of the data sign feature.
23942  This feature may not be available on all devices. Please refer to the
23943  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReadDataSignStatus"
23944  in your application to automatically determine whether this feature is available.
23945  */
23946 
23947 bool
23949  SPI_MODULE_ID index ) ;
23950 //******************************************************************************
23951 /* Function:
23952  void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
23953  Summary:
23954  Enables Master mode slave select.
23955  Description:
23956  This function enables Master mode slave select.
23957  This operation is atomic.
23958  Precondition:
23959  None.
23960  Parameters:
23961  index - Identifier for the device instance to be configured
23962  Returns:
23963  None.
23964  Example:
23965  <code>
23966  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23967  // application developer.
23968  PLIB_SPI_SlaveSelectEnable(MY_SPI_INSTANCE);
23969  </code>
23970  Remarks:
23971  This feature does not support Framed SPI mode.
23972  This function implements an operation of the Master mode slave select feature.
23973  This feature may not be available on all devices. Please refer to the
23974  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
23975  in your application to automatically determine whether this feature is available.
23976 
23977  To enable Slave mode slave select pin (SSEN), PLIB_SPI_PinEnable API can be used.
23978  */
23979 
23980 void
23982  SPI_MODULE_ID index ) ;
23983 //******************************************************************************
23984 /* Function:
23985  void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
23986  Summary:
23987  Disables Master mode slave select.
23988  Description:
23989  This function disables Master mode slave select.
23990  This operation is atomic.
23991  Precondition:
23992  None.
23993  Parameters:
23994  index - Identifier for the device instance to be configured
23995  Returns:
23996  None.
23997  Example:
23998  <code>
23999  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24000  // application developer.
24001  PLIB_SPI_SlaveSelectDisable(MY_SPI_INSTANCE);
24002  </code>
24003  Remarks:
24004  This feature does not support Framed SPI mode.
24005  This function implements an operation of the slave select feature.
24006  This feature may not be available on all devices. Please refer to the
24007  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
24008  in your application to automatically determine whether this feature is available.
24009 
24010  To disable Slave mode slave select pin (SSEN), PLIB_SPI_PinDisable API can be used.
24011  */
24012 
24013 void
24015  SPI_MODULE_ID index ) ;
24016 //******************************************************************************
24017 /* Function:
24018  bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
24019  Summary:
24020  Returns the current status of the transmit underrun.
24021  Description:
24022  This function returns the current status of the transmit underrun.
24023  This operation is atomic.
24024  Precondition:
24025  None.
24026  Parameters:
24027  index - Identifier for the device instance to be configured
24028  Returns:
24029  - true - Transmit buffer has encountered an underrun condition
24030  - false - Transmit buffer run has not encountered an underrun condition
24031  Example:
24032  <code>
24033  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24034  // application developer.
24035  bool Status = PLIB_SPI_TransmitUnderRunStatusGet(MY_SPI_INSTANCE);
24036  </code>
24037  Remarks:
24038  Valid in Framed Sync mode.
24039  This function implements an operation of the transmit underrun status feature.
24040  This feature may not be available on all devices. Please refer to the
24041  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitUnderRunStatus"
24042  in your application to automatically determine whether this feature is available.
24043  */
24044 
24045 bool
24047  SPI_MODULE_ID index ) ;
24048 //******************************************************************************
24049 /* Function:
24050  void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
24051  Summary:
24052  Clears the SPI transmit underrun flag.
24053  Description:
24054  This function clears the SPI transmit underrun flag.
24055  This operation is atomic.
24056  Precondition:
24057  None.
24058  Parameters:
24059  index - Identifier for the device instance to be configured
24060  Returns:
24061  None.
24062  Example:
24063  <code>
24064  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24065  // application developer.
24066  PLIB_SPI_TransmitUnderRunStatusClear(MY_SPI_INSTANCE);
24067  </code>
24068  Remarks:
24069  This function implements an operation of the transmit underrun status feature.
24070  This feature may not be available on all devices. Please refer to the
24071  specific device data sheet to determine availability or use "ExistsTransmitUnderRunStatus"
24072  in your application to automatically determine whether this feature is available.
24073  */
24074 
24075 void
24077  SPI_MODULE_ID index ) ;
24078 //******************************************************************************
24079 /* Function:
24080  bool PLIB_SPI_TransmitBufferIsEmpty (SPI_MODULE_ID index)
24081  Summary:
24082  Returns the current status of the transmit buffer.
24083  Description:
24084  This function returns the current status of the transmit buffer.
24085  This operation is atomic.
24086  Precondition:
24087  None.
24088  Parameters:
24089  index - Identifier for the device instance to be configured
24090  Returns:
24091  - true - Transmit buffer is empty
24092  - false - Transmit buffer is not empty
24093  Example:
24094  <code>
24095  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24096  // application developer.
24097  bool Status = PLIB_SPI_TransmitBufferIsEmpty(MY_SPI_INSTANCE);
24098  </code>
24099  Remarks:
24100  This function implements an operation of the transmit buffer empty status feature.
24101  This feature may not be available on all devices. Please refer to the
24102  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferEmptyStatus"
24103  in your application to automatically determine whether this feature is available.
24104  */
24105 
24106 bool
24108  SPI_MODULE_ID index ) ;
24109 //******************************************************************************
24110 /* Function:
24111  void PLIB_SPI_FIFOEnable (SPI_MODULE_ID index)
24112  Summary:
24113  Enables the SPI enhanced buffer.
24114  Description:
24115  This function enables the SPI enhanced buffer.
24116  This operation is atomic.
24117  Precondition:
24118  None.
24119  Parameters:
24120  index - Identifier for the device instance to be configured
24121  Returns:
24122  None.
24123  Example:
24124  <code>
24125  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24126  // application developer.
24127  PLIB_SPI_FIFOEnable(MY_SPI_INSTANCE);
24128  </code>
24129  Remarks:
24130  This enables the enhanced buffer mode.
24131  This function implements an operation of the FIFO control feature.
24132  This feature may not be available on all devices. Please refer to the
24133  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24134  in your application to automatically determine whether this feature is available.
24135  */
24136 
24137 void
24139  SPI_MODULE_ID index ) ;
24140 //******************************************************************************
24141 /* Function:
24142  void PLIB_SPI_FIFODisable (SPI_MODULE_ID index)
24143  Summary:
24144  Disables the SPI enhanced buffer.
24145  Description:
24146  This function disables the SPI enhanced buffer.
24147  This operation is atomic.
24148  Precondition:
24149  None.
24150  Parameters:
24151  index - Identifier for the device instance to be configured
24152  Returns:
24153  None.
24154  Example:
24155  <code>
24156  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24157  // application developer.
24158  PLIB_SPI_FIFODisable(MY_SPI_INSTANCE);
24159  </code>
24160  Remarks:
24161  Enables the legacy standard single buffer mode.
24162  This function implements an operation of the FIFO control feature.
24163  This feature may not be available on all devices. Please refer to the
24164  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24165  in your application to automatically determine whether this feature is available.
24166  */
24167 
24168 void
24170  SPI_MODULE_ID index ) ;
24171 //******************************************************************************
24172 /* Function:
24173  uint8_t PLIB_SPI_FIFOCountGet (SPI_MODULE_ID index, SPI_FIFO_TYPE type)
24174  Summary:
24175  Reads the SPI Buffer Element Count bits for either receive or transmit.
24176  Description:
24177  This function reads the number of SPI transfers pending for Master mode
24178  and the number of unread SPI transfers for Slave mode.
24179  Precondition:
24180  None.
24181  Parameters:
24182  index - Identifier for the device instance to be configured
24183  type - One of the SPI_FIFO_TYPE enumeration values
24184  Returns:
24185  CountValue - Buffer element count bits
24186  Example:
24187  <code>
24188  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24189  // application developer.
24190  uint8_t count = PLIB_SPI_FIFOCountGet(MY_SPI_INSTANCE,SPI_FIFO_TYPE_TRANSMIT);
24191  </code>
24192  Remarks:
24193  Valid in Enhanced Buffer mode.
24194  This function implements an operation of the FIFO control feature.
24195  This feature may not be available on all devices. Please refer to the
24196  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOCount"
24197  in your application to automatically determine whether this feature is available.
24198  */
24199 
24200 uint8_t
24202  SPI_MODULE_ID index ,
24203  SPI_FIFO_TYPE type ) ;
24204 //******************************************************************************
24205 /* Function:
24206  bool PLIB_SPI_FIFOShiftRegisterIsEmpty (SPI_MODULE_ID index)
24207  Summary:
24208  Returns the current status of the SPI shift register.
24209  Description:
24210  This function returns the current status of the SPI shift register.
24211  This operation is atomic.
24212  Precondition:
24213  None.
24214  Parameters:
24215  index - Identifier for the device instance to be configured
24216  Returns:
24217  - true - SPI shift register is empty and ready to send or receive
24218  - false - SPI shift register is not empty
24219  Example:
24220  <code>
24221  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24222  // application developer.
24223  bool Status = PLIB_SPI_FIFOShiftRegisterIsEmpty(MY_SPI_INSTANCE);
24224  </code>
24225  Remarks:
24226  Valid in Enhanced Buffer mode.
24227  This function implements an operation of the FIFO status feature.
24228  This feature may not be available on all devices. Please refer to the
24229  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus"
24230  in your application to automatically determine whether this feature is available.
24231  */
24232 
24233 bool
24235  SPI_MODULE_ID index ) ;
24236 //******************************************************************************
24237 /* Function:
24238  bool PLIB_SPI_ReceiverFIFOIsEmpty (SPI_MODULE_ID index)
24239  Summary:
24240  Returns the current status of the SPI receive FIFO.
24241  Description:
24242  This function returns the current status of the SPI receive FIFO.
24243  This operation is atomic.
24244  Precondition:
24245  None.
24246  Parameters:
24247  index - Identifier for the device instance to be configured
24248  Returns:
24249  - true - Receive FIFO is empty
24250  - false - Receive FIFO is not empty
24251  Example:
24252  <code>
24253  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24254  // application developer.
24255  bool fifostate = PLIB_SPI_ReceiverFIFOIsEmpty (MY_SPI_INSTANCE);
24256  </code>
24257  Remarks:
24258  Valid in Enhanced Buffer mode.
24259  This function implements an operation of the FIFO status feature.
24260  This feature may not be available on all devices. Please refer to the
24261  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveFIFOStatus"
24262  in your application to automatically determine whether this feature is available.
24263  */
24264 
24265 bool
24267  SPI_MODULE_ID index ) ;
24268 //******************************************************************************
24269 /* Function:
24270  void PLIB_SPI_FIFOInterruptModeSelect (SPI_MODULE_ID index,
24271  SPI_FIFO_INTERRUPT mode)
24272  Summary:
24273  Selects the SPI buffer interrupt mode.
24274  Description:
24275  This function selects the SPI buffer interrupt mode from SPI_FIFO_INTERRUPT.
24276  Precondition:
24277  None.
24278  Parameters:
24279  index - Identifier for the device instance to be configured
24280  mode - One of the SPI_FIFO_INTERRUPT enumeration values as the SPI buffer
24281  interrupt mode
24282  Returns:
24283  None.
24284  Example:
24285  <code>
24286  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24287  // application developer.
24288  PLIB_SPI_FIFOInterruptModeSelect(MY_SPI_INSTANCE,
24289  SPI_FIFO_INTERRUPT_WHEN_TRANSMIT_BUFFER_IS_NOT_FULL);
24290  </code>
24291  Remarks:
24292  Valid in Enhanced Buffer mode.
24293  This function implements an operation of the FIFO interrupt feature.
24294  This feature may not be available on all devices. Please refer to the
24295  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOInterruptMode"
24296  in your application to automatically determine whether this feature is available.
24297  */
24298 
24299 void
24301  SPI_MODULE_ID index ,
24302  SPI_FIFO_INTERRUPT mode ) ;
24303 //******************************************************************************
24304 /* Function:
24305  void PLIB_SPI_FramedCommunicationEnable (SPI_MODULE_ID index)
24306  Summary:
24307  Enables framed SPI support.
24308  Description:
24309  This function enables framed SPI support.
24310  This operation is atomic.
24311  Precondition:
24312  None.
24313  Parameters:
24314  index - Identifier for the device instance to be configured
24315  Returns:
24316  None.
24317  Example:
24318  <code>
24319  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24320  // application developer.
24321  PLIB_SPI_FramedCommunicationEnable(MY_SPI_INSTANCE);
24322  </code>
24323  Remarks:
24324  This function implements an operation of the framed communication feature.
24325  This feature may not be available on all devices. Please refer to the
24326  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24327  in your application to automatically determine whether this feature is available.
24328  */
24329 
24330 void
24332  SPI_MODULE_ID index ) ;
24333 //******************************************************************************
24334 /* Function:
24335  void PLIB_SPI_FramedCommunicationDisable (SPI_MODULE_ID index)
24336  Summary:
24337  Disables framed SPI support.
24338  Description:
24339  This function disables framed SPI support.
24340  This operation is atomic.
24341  Precondition:
24342  None.
24343  Parameters:
24344  index - Identifier for the device instance to be configured
24345  Returns:
24346  None.
24347  Example:
24348  <code>
24349  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24350  // application developer.
24351  PLIB_SPI_FramedCommunicationDisable(MY_SPI_INSTANCE);
24352  </code>
24353  Remarks:
24354  This function implements an operation of the framed communication feature.
24355  This feature may not be available on all devices. Please refer to the
24356  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24357  in your application to automatically determine whether this feature is available.
24358  */
24359 
24360 void
24362  SPI_MODULE_ID index ) ;
24363 //******************************************************************************
24364 /* Function:
24365  void PLIB_SPI_FrameSyncPulseDirectionSelect (SPI_MODULE_ID index,
24366  SPI_FRAME_PULSE_DIRECTION direction)
24367  Summary:
24368  Selects the frame sync pulse direction.
24369  Description:
24370  This function selects the frame sync pulse direction.
24371  Precondition:
24372  None.
24373  Parameters:
24374  index - Identifier for the device instance to be configured
24375  direction - One of the SPI_FRAME_PULSE_DIRECTION enumeration values
24376  as the SPI frame sync pulse polarity
24377  Returns:
24378  None.
24379  Example:
24380  <code>
24381  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24382  // application developer.
24383  PLIB_SPI_FrameSyncPulseDirectionSelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_DIRECTION_INPUT );
24384  </code>
24385  Remarks:
24386  This function implements an operation of the framed communication feature.
24387  This feature may not be available on all devices. Please refer to the
24388  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseDirection"
24389  in your application to automatically determine whether this feature is available.
24390  */
24391 
24392 void
24394  SPI_MODULE_ID index ,
24395  SPI_FRAME_PULSE_DIRECTION direction ) ;
24396 //******************************************************************************
24397 /* Function:
24398  void PLIB_SPI_FrameSyncPulsePolaritySelect (SPI_MODULE_ID index,
24399  SPI_FRAME_PULSE_POLARITY polarity)
24400  Summary:
24401  Selects the frame sync pulse polarity.
24402  Description:
24403  This function selects the frame sync pulse polarity.
24404  Precondition:
24405  None.
24406  Parameters:
24407  index - Identifier for the device instance to be configured
24408  polarity - One of the SPI_FRAME_PULSE_POLARITY enumeration values as the SPI frame
24409  sync pulse polarity
24410  Returns:
24411  None.
24412  Example:
24413  <code>
24414  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24415  // application developer.
24416  PLIB_SPI_FrameSyncPulsePolaritySelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_POLARITY_ACTIVE_HIGH );
24417  </code>
24418  Remarks:
24419  Available only for Frame mode.
24420  This function implements an operation of the framed communication feature.
24421  This feature may not be available on all devices. Please refer to the
24422  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulsePolarity"
24423  in your application to automatically determine whether this feature is available.
24424  */
24425 
24426 void
24428  SPI_MODULE_ID index ,
24429  SPI_FRAME_PULSE_POLARITY polarity ) ;
24430 //******************************************************************************
24431 /* Function:
24432  void PLIB_SPI_FrameSyncPulseEdgeSelect (SPI_MODULE_ID index,
24433  SPI_FRAME_PULSE_EDGE edge)
24434  Summary:
24435  Selects the frame sync pulse edge.
24436  Description:
24437  This function selects the frame sync pulse edge.
24438  Precondition:
24439  None.
24440  Parameters:
24441  index - Identifier for the device instance to be configured
24442  edge - One of the SPI_FRAME_PULSE_EDGE enumeration values as the
24443  SPI frame sync pulse edge
24444  Returns:
24445  None.
24446  Example:
24447  <code>
24448  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24449  // application developer.
24450  PLIB_SPI_FrameSyncPulseEdgeSelect(MY_SPI_INSTANCE,
24451  SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK);
24452  </code>
24453  Remarks:
24454  This function implements an operation of the framed communication feature.
24455  This feature may not be available on all devices. Please refer to the
24456  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseEdge"
24457  in your application to automatically determine whether this feature is available.
24458  */
24459 
24460 void
24462  SPI_MODULE_ID index ,
24463  SPI_FRAME_PULSE_EDGE edge ) ;
24464 //******************************************************************************
24465 /* Function:
24466  void PLIB_SPI_FrameSyncPulseWidthSelect (SPI_MODULE_ID index,
24467  SPI_FRAME_PULSE_WIDTH width)
24468  Summary:
24469  Sets the frame sync pulse width.
24470  Description:
24471  This function sets the frame sync pulse width.
24472  Precondition:
24473  None.
24474  Parameters:
24475  index - Identifier for the device instance to be configured
24476  edge - One of the SPI_FRAME_PULSE_WIDTH enumeration values as the SPI
24477  frame sync pulse width.
24478  Returns:
24479  None.
24480  Example:
24481  <code>
24482  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24483  // application developer.
24484  PLIB_SPI_FrameSyncPulseWidthSelect (MY_SPI_INSTANCE,SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH);
24485  </code>
24486  Remarks:
24487  Length of the word is dependent on the communication mode.
24488  This function implements an operation of the framed communication feature.
24489  This feature may not be available on all devices. Please refer to the
24490  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseWidth"
24491  in your application to automatically determine whether this feature is available.
24492  */
24493 
24494 void
24496  SPI_MODULE_ID index ,
24497  SPI_FRAME_PULSE_WIDTH width ) ;
24498 //******************************************************************************
24499 /* Function:
24500  void PLIB_SPI_FrameSyncPulseCounterSelect (SPI_MODULE_ID index,
24501  SPI_FRAME_SYNC_PULSE pulse)
24502  Summary:
24503  Selects at which character the SPI frame sync pulse is generated.
24504  Description:
24505  This function selects at which character the SPI frame sync pulse is generated.
24506  Precondition:
24507  None.
24508  Parameters:
24509  index - Identifier for the device instance to be configured
24510  pulse - One of the SPI_FRAME_SYNC_PULSE enumeration values as the SPI
24511  frame sync pulse count
24512  Returns:
24513  None.
24514  Example:
24515  <code>
24516  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24517  // application developer.
24518  PLIB_SPI_FrameSyncPulseCounterSelect(MY_SPI_INSTANCE,
24519  SPI_FRAME_SYNC_PULSE_ON_EVERY_32_DATA_CHARACTER );
24520  </code>
24521  Remarks:
24522  This is valid only when PLIB_SPI_FramedCommunicationEnable is enabled.
24523  This function implements an operation of the framed communication feature.
24524  This feature may not be available on all devices. Please refer to the
24525  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseCounter"
24526  in your application to automatically determine whether this feature is available.
24527  */
24528 
24529 void
24531  SPI_MODULE_ID index ,
24532  SPI_FRAME_SYNC_PULSE pulse ) ;
24533 //******************************************************************************
24534 /* Function:
24535  bool PLIB_SPI_FrameErrorStatusGet (SPI_MODULE_ID index)
24536  Summary:
24537  Returns the current status of the SPI frame error.
24538  Description:
24539  This function returns the current status of the SPI frame error.
24540  This operation is atomic.
24541  Precondition:
24542  None.
24543  Parameters:
24544  index - Identifier for the device instance to be configured
24545  Returns:
24546  - true - Frame error detected
24547  - false - No frame error detected
24548  Example:
24549  <code>
24550  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24551  // application developer.
24552  bool status = PLIB_SPI_FrameErrorStatusGet(MY_SPI_INSTANCE);
24553  </code>
24554  Remarks:
24555  Valid only if Frame mode is enabled.
24556  This function implements an operation of the framed communication feature.
24557  This feature may not be available on all devices. Please refer to the
24558  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameErrorStatus"
24559  in your application to automatically determine whether this feature is available.
24560  */
24561 
24562 bool
24564  SPI_MODULE_ID index ) ;
24565 //******************************************************************************
24566 /* Function:
24567  void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
24568  Summary:
24569  Clears the SPI frame error flag.
24570  Description:
24571  This function clears the SPI frame error flag.
24572  This operation is atomic.
24573  Precondition:
24574  None.
24575  Parameters:
24576  index - Identifier for the device instance to be configured
24577  Returns:
24578  None.
24579  Example:
24580  <code>
24581  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24582  // application developer.
24583  PLIB_SPI_FrameErrorStatusClear(MY_SPI_INSTANCE);
24584  </code>
24585  Remarks:
24586  This function implements an operation of the frame error status feature.
24587  This feature may not be available on all devices. Please refer to the
24588  specific device data sheet to determine availability or use "ExistsFrameErrorStatus"
24589  in your application to automatically determine whether this feature is available.
24590  */
24591 
24592 void
24594  SPI_MODULE_ID index ) ;
24595 //******************************************************************************
24596 /* Function:
24597  void PLIB_SPI_BufferClear (SPI_MODULE_ID index)
24598  Summary:
24599  Clears the SPI receive buffer.
24600  Description:
24601  This function clears the SPI receive buffer.
24602  In Enhanced Buffer mode, this functions clears the full RX FIFO.
24603  This operation is atomic.
24604  Precondition:
24605  None.
24606  Parameters:
24607  index - Identifier for the device instance to be configured
24608  Returns:
24609  None.
24610  Example:
24611  <code>
24612  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24613  // application developer.
24614  //This call will flush the receive buffer.
24615  PLIB_SPI_BufferClear(MY_SPI_INSTANCE);
24616  </code>
24617  Remarks:
24618  This function implements an operation of the buffer control feature.
24619  This feature may not be available on all devices. Please refer to the
24620  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24621  in your application to automatically determine whether this feature is available.
24622  */
24623 
24624 void
24626  SPI_MODULE_ID index ) ;
24627 //******************************************************************************
24628 /* Function:
24629  uint8_t PLIB_SPI_BufferRead (SPI_MODULE_ID index)
24630  Summary:
24631  Returns the SPI buffer value.
24632  Description:
24633  This function returns the SPI buffer value.
24634  This operation is atomic.
24635  Precondition:
24636  None.
24637  Parameters:
24638  index - Identifier for the device instance to be configured
24639  Returns:
24640  Reads the SPI buffer.
24641  Example:
24642  <code>
24643  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24644  // application developer.
24645  uint8_t bufferValue = PLIB_SPI_BufferRead(MY_SPI_INSTANCE);
24646  </code>
24647  Remarks:
24648  This function implements an operation of the buffer control feature.
24649  This feature may not be available on all devices. Please refer to the
24650  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24651  in your application to automatically determine whether this feature is available.
24652  */
24653 
24654 uint8_t
24656  SPI_MODULE_ID index ) ;
24657 //******************************************************************************
24658 /* Function:
24659  uint16_t PLIB_SPI_BufferRead16bit ( SPI_MODULE_ID index )
24660  Summary:
24661  Returns 16-bit SPI buffer value.
24662  Description:
24663  This function returns 16-bit SPI buffer value.
24664  This operation is atomic.
24665  Precondition:
24666  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24667  Parameters:
24668  index - Identifier for the device instance to be configured
24669  Returns:
24670  Returns the SPI 16-bit buffer value.
24671  Example:
24672  <code>
24673 #define MY_SPI_INSTANCE SPI_ID_1
24674 
24675  uint16_t bufferValue = PLIB_SPI_BufferRead16bit( MY_SPI_INSTANCE );
24676  </code>
24677  Remarks:
24678  This function implements an operation of the buffer control feature.
24679  This feature may not be available on all devices. Please refer to the
24680  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
24681  in your application to automatically determine whether this feature is available.
24682  */
24683 
24684 uint16_t
24686  SPI_MODULE_ID index ) ;
24687 //******************************************************************************
24688 /* Function:
24689  uint32_t PLIB_SPI_BufferRead32bit ( SPI_MODULE_ID index )
24690  Summary:
24691  Returns 32-bit SPI buffer value.
24692  Description:
24693  This function returns 32-bit SPI buffer value.
24694  This operation is atomic.
24695  Precondition:
24696  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24697  Parameters:
24698  index - Identifier for the device instance to be configured
24699  Returns:
24700  Returns the SPI 32-bit buffer value.
24701  Example:
24702  <code>
24703 #define MY_SPI_INSTANCE SPI_ID_1
24704 
24705  uint32_t bufferValue = PLIB_SPI_BufferRead32bit( MY_SPI_INSTANCE );
24706  </code>
24707  Remarks:
24708  This function implements an operation of the buffer control feature.
24709  This feature may not be available on all devices. Please refer to the
24710  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
24711  in your application to automatically determine whether this feature is available.
24712  */
24713 
24714 uint32_t
24716  SPI_MODULE_ID index ) ;
24717 //******************************************************************************
24718 /* Function:
24719  void PLIB_SPI_BufferWrite ( SPI_MODULE_ID index , uint8_t data )
24720  Summary:
24721  Write the data to the SPI buffer.
24722  Description:
24723  This function writes data to the SPI buffer.
24724  This operation is atomic.
24725  Precondition:
24726  None.
24727  Parameters:
24728  index - Identifier for the device instance to be configured
24729  data - Data to written to the SPI buffer
24730  Returns:
24731  None.
24732  Example:
24733  <code>
24734  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24735  // application developer.
24736  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0xFF );
24737  </code>
24738  Remarks:
24739  This function implements an operation of the buffer control feature.
24740  This feature may not be available on all devices. Please refer to the
24741  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24742  in your application to automatically determine whether this feature is available.
24743  */
24744 
24745 void
24747  SPI_MODULE_ID index ,
24748  uint8_t data ) ;
24749 //******************************************************************************
24750 /* Function:
24751  void PLIB_SPI_BufferWrite16bit ( SPI_MODULE_ID index , uint16_t data )
24752  Summary:
24753  Writes 16-bit data to the SPI buffer.
24754  Description:
24755  This function writes 16-bit data to the SPI buffer.
24756  This operation is atomic.
24757  Precondition:
24758  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24759  Parameters:
24760  index - Identifier for the device instance to be configured
24761  data - 16-bit data to be written to the SPI buffer
24762  Returns:
24763  None.
24764  Example:
24765  <code>
24766 #define MY_SPI_INSTANCE SPI_ID_1
24767 
24768  PLIB_SPI_BufferWrite16bit ( MY_SPI_INSTANCE, 0x55AA );
24769  </code>
24770  Remarks:
24771  This function implements an operation of the buffer control feature.
24772  This feature may not be available on all devices. Please refer to the
24773  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
24774  in your application to automatically determine whether this feature is available.
24775  */
24776 
24777 void
24779  SPI_MODULE_ID index ,
24780  uint16_t data ) ;
24781 //******************************************************************************
24782 /* Function:
24783  void PLIB_SPI_BufferWrite32bit ( SPI_MODULE_ID index , uint32_t data )
24784  Summary:
24785  Write 32-bit data to the SPI buffer.
24786  Description:
24787  This function writes 32-bit data to the SPI buffer.
24788  This operation is atomic.
24789  Precondition:
24790  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24791  Parameters:
24792  index - Identifier for the device instance to be configured
24793  data - 32-bit data to be written to the SPI buffer
24794  Returns:
24795  None.
24796  Example:
24797  <code>
24798 #define MY_SPI_INSTANCE SPI_ID_1
24799 
24800  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0x55AA55AA );
24801  </code>
24802  Remarks:
24803  This function implements an operation of the buffer control feature.
24804  This feature may not be available on all devices. Please refer to the
24805  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
24806  in your application to automatically determine whether this feature is available.
24807  */
24808 
24809 void
24811  SPI_MODULE_ID index ,
24812  uint32_t data ) ;
24813 //******************************************************************************
24814 /* Function : PLIB_SPI_BufferAddressGet( SPI_MODULE_ID index )
24815  Summary:
24816  Returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive (SPIxRXB))
24817  register.
24818  Description:
24819  This function returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive
24820  (SPIxRXB)) register.
24821  This operation is atomic.
24822  Preconditions:
24823  None.
24824  Parameters:
24825  index - Identifier for the device instance
24826  Returns:
24827  The address of the SPIxBUF register
24828  Remarks:
24829  None.
24830 */
24831 
24832 void *
24834  SPI_MODULE_ID index ) ;
24835 //******************************************************************************
24836 /* Function:
24837  void PLIB_SPI_BaudRateClockSelect (SPI_MODULE_ID index,
24838  SPI_BAUD_RATE_CLOCK type)
24839  Summary:
24840  Selects the type of clock is used by the Baud Rate Generator.
24841  Description:
24842  This function selects the type of clock is used by the Baud Rate Generator.
24843  Precondition:
24844  None.
24845  Parameters:
24846  index - Identifier for the device instance to be configured
24847  type - One of the SPI_BAUD_RATE_CLOCK enumeration values as the SPI baud clock
24848  Returns:
24849  None.
24850  Example:
24851  <code>
24852  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24853  // application developer.
24854  PLIB_SPI_BaudRateClockSelect (MY_SPI_INSTANCE, SPI_BAUD_RATE_MCLK_CLOCK);
24855  </code>
24856  Remarks:
24857  This function implements an operation of the baud rate clock control feature.
24858  This feature may not be available on all devices. Please refer to the
24859  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRateClock"
24860  in your application to automatically determine whether this feature is available.
24861  */
24862 
24863 void
24865  SPI_MODULE_ID index ,
24866  SPI_BAUD_RATE_CLOCK type ) ;
24867 //******************************************************************************
24868 /* Function:
24869  void PLIB_SPI_ErrorInterruptEnable (SPI_MODULE_ID index,
24870  SPI_ERROR_INTERRUPT error)
24871  Summary:
24872  Enables SPI error interrupts
24873  Description:
24874  This function enables SPI error interrupts.
24875  Precondition:
24876  None.
24877  Parameters:
24878  index - Identifier for the device instance to be configured
24879  type - One of the SPI_ERROR_INTERRUPT enumeration values as the
24880  SPI interrupt error
24881  Returns:
24882  None.
24883  Example:
24884  <code>
24885  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24886  // application developer.
24887  PLIB_SPI_ErrorInterruptEnable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
24888  </code>
24889  Remarks:
24890  This function implements an operation of the error interrupt control feature.
24891  This feature may not be available on all devices. Please refer to the
24892  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
24893  in your application to automatically determine whether this feature is available.
24894  */
24895 
24896 void
24898  SPI_MODULE_ID index ,
24899  SPI_ERROR_INTERRUPT error ) ;
24900 //******************************************************************************
24901 /* Function:
24902  void PLIB_SPI_ErrorInterruptDisable (SPI_MODULE_ID index,
24903  SPI_ERROR_INTERRUPT error)
24904  Summary:
24905  Enables SPI error interrupts.
24906  Description:
24907  This function enables SPI error interrupts.
24908  Precondition:
24909  None.
24910  Parameters:
24911  index - Identifier for the device instance to be configured
24912  error - One of the SPI_ERROR_INTERRUPT enumeration values as the
24913  SPI interrupt error
24914  Returns:
24915  None.
24916  Example:
24917  <code>
24918  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24919  // application developer.
24920  PLIB_SPI_ErrorInterruptDisable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
24921  </code>
24922  Remarks:
24923  This function implements an operation of the error interrupt control feature.
24924  This feature may not be available on all devices. Please refer to the
24925  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
24926  in your application to automatically determine whether this feature is available.
24927  */
24928 
24929 void
24931  SPI_MODULE_ID index ,
24932  SPI_ERROR_INTERRUPT error ) ;
24933 //******************************************************************************
24934 /* Function:
24935  void PLIB_SPI_AudioErrorEnable (SPI_MODULE_ID index, SPI_Audio_ERROR error)
24936  Summary:
24937  Enables the SPI error.
24938  Description:
24939  This function enables the SPI error.
24940  This operation is atomic.
24941  Precondition:
24942  None.
24943  Parameters:
24944  index - Identifier for the device instance to be configured
24945  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
24946  Returns:
24947  None.
24948  Example:
24949  <code>
24950  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24951  // application developer.
24952  PLIB_SPI_AudioErrorEnable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
24953  </code>
24954  Remarks:
24955  This function implements an operation of the audio error control feature.
24956  This feature may not be available on all devices. Please refer to the
24957  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
24958  in your application to automatically determine whether this feature is available.
24959  */
24960 
24961 void
24963  SPI_MODULE_ID index ,
24964  SPI_AUDIO_ERROR error ) ;
24965 //******************************************************************************
24966 /* Function:
24967  void PLIB_SPI_AudioErrorDisable (SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
24968  Summary:
24969  Disables the SPI error.
24970  Description:
24971  This function disables the SPI error.
24972  This operation is atomic.
24973  Precondition:
24974  None.
24975  Parameters:
24976  index - Identifier for the device instance to be configured
24977  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
24978  Returns:
24979  None.
24980  Example:
24981  <code>
24982  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24983  // application developer.
24984  PLIB_SPI_AudioErrorDisable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
24985  </code>
24986  Remarks:
24987  This function implements an operation of the audio error control feature.
24988  This feature may not be available on all devices. Please refer to the
24989  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
24990  in your application to automatically determine whether this feature is available.
24991  */
24992 
24993 void
24995  SPI_MODULE_ID index ,
24996  SPI_AUDIO_ERROR error ) ;
24997 //******************************************************************************
24998 /* Function:
24999  void PLIB_SPI_AudioProtocolEnable (SPI_MODULE_ID index)
25000  Summary:
25001  Audio protocol is enabled.
25002  Description:
25003  This function enables the audio protocol.
25004  This operation is atomic.
25005  Precondition:
25006  Disable the SPI module by calling PLIB_SPI_Disable.
25007  Parameters:
25008  index - Identifier for the device instance to be configured
25009  Returns:
25010  None.
25011  Example:
25012  <code>
25013  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25014  // application developer.
25015  PLIB_SPI_AudioProtocolEnable(MY_SPI_INSTANCE);
25016  </code>
25017  Remarks:
25018  This function implements an operation of the audio protocol control feature.
25019  This feature may not be available on all devices. Please refer to the
25020  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25021  in your application to automatically determine whether this feature is available.
25022  */
25023 
25024 void
25026  SPI_MODULE_ID index ) ;
25027 //******************************************************************************
25028 /* Function:
25029  void PLIB_SPI_AudioProtocolDisable (SPI_MODULE_ID index)
25030  Summary:
25031  Audio protocol is disabled.
25032  Description:
25033  This function disables the audio protocol.
25034  This operation is atomic.
25035  Precondition:
25036  None.
25037  Parameters:
25038  index - Identifier for the device instance to be configured
25039  Returns:
25040  None.
25041  Example:
25042  <code>
25043  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25044  // application developer.
25045  PLIB_SPI_AudioProtocolDisable(MY_SPI_INSTANCE);
25046  </code>
25047  Remarks:
25048  This function implements an operation of the audio protocol control feature.
25049  This feature may not be available on all devices. Please refer to the
25050  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25051  in your application to automatically determine whether this feature is available.
25052  */
25053 
25054 void
25056  SPI_MODULE_ID index ) ;
25057 //******************************************************************************
25058 /* Function:
25059  void PLIB_SPI_AudioTransmitModeSelect (SPI_MODULE_ID index,
25060  SPI_AUDIO_TRANSMIT_MODE mode)
25061  Summary:
25062  Selects the transmit audio data format.
25063  Description:
25064  This function selects the transmit audio data format.
25065  Precondition:
25066  None.
25067  Parameters:
25068  index - Identifier for the device instance to be configured
25069  mode - One of the SPI_TRANSMIT_AUDIO_MODE enumeration values as the
25070  transmit audio format
25071  Returns:
25072  None.
25073  Example:
25074  <code>
25075  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25076  // application developer.
25077  PLIB_SPI_AudioTransmitModeSelect (MY_SPI_INSTANCE, SPI_AUDIO_TRANSMIT_MONO);
25078  </code>
25079  Remarks:
25080  This function implements an operation of the audio transmit mode feature.
25081  This feature may not be available on all devices. Please refer to the
25082  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioTransmitMode"
25083  in your application to automatically determine whether this feature is available.
25084  */
25085 
25086 void
25088  SPI_MODULE_ID index ,
25089  SPI_AUDIO_TRANSMIT_MODE mode ) ;
25090 //******************************************************************************
25091 /* Function:
25092  void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index,
25093  SPI_AUDIO_PROTOCOL mode )
25094  Summary:
25095  Selects the Audio Protocol mode.
25096  Description:
25097  This function selects the Audio Protocol mode.
25098  Precondition:
25099  None.
25100  Parameters:
25101  index - Identifier for the device instance to be configured
25102  mode - One of the SPI_AUDIO_PROTOCOL enumeration values as the
25103  audio protocol
25104  Returns:
25105  None.
25106  Example:
25107  <code>
25108  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25109  // application developer.
25110  PLIB_SPI_AudioProtocolModeSelect(MY_SPI_INSTANCE,SPI_AUDIO_PROTOCOL_RIGHT_JUSTIFIED );
25111  </code>
25112  Remarks:
25113  This function implements an operation of the audio protocol mode feature.
25114  This feature may not be available on all devices. Please refer to the
25115  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolMode"
25116  in your application to automatically determine whether this feature is available.
25117  */
25118 
25119 void
25121  SPI_MODULE_ID index ,
25122  SPI_AUDIO_PROTOCOL mode ) ;
25123 // *****************************************************************************
25124 // *****************************************************************************
25125 // Section: SPI Peripheral Library Exists Functions
25126 // *****************************************************************************
25127 // *****************************************************************************
25128 /* The following functions indicate the existence of the features on the device.
25129 */
25130 //******************************************************************************
25131 /* Function:
25132  PLIB_SPI_ExistsEnableControl( SPI_MODULE_ID index )
25133  Summary:
25134  Identifies whether the EnableControl feature exists on the SPI module.
25135  Description:
25136  This function identifies whether the EnableControl feature is available on
25137  the SPI module.
25138  When this function returns true, these functions are supported on the device:
25139  - PLIB_SPI_Enable
25140  - PLIB_SPI_Disable
25141  This operation is atomic.
25142  Preconditions:
25143  None.
25144  Parameters:
25145  index - Identifier for the device instance
25146  Returns:
25147  - true - The EnableControl feature is supported on the device
25148  - false - The EnableControl feature is not supported on the device
25149  Remarks:
25150  None.
25151 */
25152 
25153 bool
25155  SPI_MODULE_ID index ) ;
25156 //******************************************************************************
25157 /* Function:
25158  PLIB_SPI_ExistsStopInIdleControl( SPI_MODULE_ID index )
25159  Summary:
25160  Identifies whether the StopInIdle feature exists on the SPI module.
25161  Description:
25162  This function identifies whether the StopInIdle feature is available on the
25163  SPI module.
25164  When this function returns true, these functions are supported on the device:
25165  - PLIB_SPI_StopInIdleEnable
25166  - PLIB_SPI_StopInIdleDisable
25167  This operation is atomic.
25168  Preconditions:
25169  None.
25170  Parameters:
25171  index - Identifier for the device instance
25172  Returns:
25173  - true - The StopInIdle feature is supported on the device
25174  - false - The StopInIdle feature is not supported on the device
25175  Remarks:
25176  None.
25177 */
25178 
25179 bool
25181  SPI_MODULE_ID index ) ;
25182 //******************************************************************************
25183 /* Function:
25184  PLIB_SPI_ExistsReceiverOverflow( SPI_MODULE_ID index )
25185  Summary:
25186  Identifies whether the ReceiverOverflow feature exists on the SPI module.
25187  Description:
25188  This function identifies whether the ReceiverOverflow feature is available
25189  on the SPI module.
25190  When this function returns true, these functions are supported on the device:
25191  - PLIB_SPI_ReceiverHasOverflowed
25192  - PLIB_SPI_ReceiverOverflowClear
25193  This operation is atomic.
25194  Preconditions:
25195  None.
25196  Parameters:
25197  index - Identifier for the device instance
25198  Returns:
25199  - true - The ReceiverOverflow feature is supported on the device
25200  - false - The ReceiverOverflow feature is not supported on the device
25201  Remarks:
25202  None.
25203 */
25204 
25205 bool
25207  SPI_MODULE_ID index ) ;
25208 //******************************************************************************
25209 /* Function:
25210  PLIB_SPI_ExistsTransmitBufferFullStatus( SPI_MODULE_ID index )
25211  Summary:
25212  Identifies whether the TransmitBufferFullStatus feature exists on the SPI module.
25213  Description:
25214  This function identifies whether the TransmitBufferFullStatus feature is available
25215  on the SPI module.
25216  When this function returns true, this function is supported on the device:
25217  - PLIB_SPI_TransmitBufferIsFull
25218  This operation is atomic.
25219  Preconditions:
25220  None.
25221  Parameters:
25222  index - Identifier for the device instance
25223  Returns:
25224  - true - The TransmitBufferFullStatus feature is supported on the device
25225  - false - The TransmitBufferFullStatus feature is not supported on the device
25226  Remarks:
25227  None.
25228 */
25229 
25230 bool
25232  SPI_MODULE_ID index ) ;
25233 //******************************************************************************
25234 /* Function:
25235  PLIB_SPI_ExistsTransmitBufferEmptyStatus( SPI_MODULE_ID index )
25236  Summary:
25237  Identifies whether the TransmitBufferEmptyStatus feature exists on the SPI module.
25238  Description:
25239  This function identifies whether the TransmitBufferEmptyStatus feature is available
25240  on the SPI module.
25241  When this function returns true, this function is supported on the device:
25242  - PLIB_SPI_TransmitBufferIsEmpty
25243  This operation is atomic.
25244  Preconditions:
25245  None.
25246  Parameters:
25247  index - Identifier for the device instance
25248  Returns:
25249  - true - The TransmitBufferEmptyStatus feature is supported on the device
25250  - false - The TransmitBufferEmptyStatus feature is not supported on the device
25251  Remarks:
25252  None.
25253 */
25254 
25255 bool
25257  SPI_MODULE_ID index ) ;
25258 //******************************************************************************
25259 /* Function:
25260  PLIB_SPI_ExistsReceiveBufferStatus( SPI_MODULE_ID index )
25261  Summary:
25262  Identifies whether the ReceiveBufferStatus feature exists on the SPI module.
25263  Description:
25264  This function identifies whether the ReceiveBufferStatus feature is available
25265  on the SPI module.
25266  When this function returns true, this function is supported on the device:
25267  - PLIB_SPI_ReceiverBufferIsFull
25268  This operation is atomic.
25269  Preconditions:
25270  None.
25271  Parameters:
25272  index - Identifier for the device instance
25273  Returns:
25274  - true - The ReceiveBufferStatus feature is supported on the device
25275  - false - The ReceiveBufferStatus feature is not supported on the device
25276  Remarks:
25277  None.
25278 */
25279 
25280 bool
25282  SPI_MODULE_ID index ) ;
25283 //******************************************************************************
25284 /* Function:
25285  PLIB_SPI_ExistsPinControl( SPI_MODULE_ID index )
25286  Summary:
25287  Identifies whether the PinControl feature exists on the SPI module.
25288  Description:
25289  This function identifies whether the PinControl feature is available on the
25290  SPI module.
25291  When this function returns true, these functions are supported on the device:
25292  - PLIB_SPI_PinEnable
25293  - PLIB_SPI_PinDisable
25294  This operation is atomic.
25295  Preconditions:
25296  None.
25297  Parameters:
25298  index - Identifier for the device instance
25299  Returns:
25300  - true - The PinControl feature is supported on the device
25301  - false - The PinControl feature is not supported on the device
25302  Remarks:
25303  None.
25304 */
25305 
25306 bool
25308  SPI_MODULE_ID index ) ;
25309 //******************************************************************************
25310 /* Function:
25311  PLIB_SPI_ExistsCommunicationWidth( SPI_MODULE_ID index )
25312  Summary:
25313  Identifies whether the CommunicationWidth feature exists on the SPI module.
25314  Description:
25315  This function identifies whether the CommunicationWidth feature is available
25316  on the SPI module.
25317  When this function returns true, this function is supported on the device:
25318  - PLIB_SPI_CommunicationWidthSelect
25319  This operation is atomic.
25320  Preconditions:
25321  None.
25322  Parameters:
25323  index - Identifier for the device instance
25324  Returns:
25325  - true - The CommunicationWidth feature is supported on the device
25326  - false - The CommunicationWidth feature is not supported on the device
25327  Remarks:
25328  None.
25329 */
25330 
25331 bool
25333  SPI_MODULE_ID index ) ;
25334 //******************************************************************************
25335 /* Function:
25336  PLIB_SPI_ExistsAudioCommunicationWidth( SPI_MODULE_ID index )
25337  Summary:
25338  Identifies whether the AudioCommunicationWidth feature exists on the SPI module.
25339  Description:
25340  This function identifies whether the AudioCommunicationWidth feature is available
25341  on the SPI module.
25342  When this function returns true, this function is supported on the device:
25343  - PLIB_SPI_AudioCommunicationWidthSelect
25344  This operation is atomic.
25345  Preconditions:
25346  None.
25347  Parameters:
25348  index - Identifier for the device instance
25349  Returns:
25350  - true - The AudioCommunicationWidth feature is supported on the device
25351  - false - The AudioCommunicationWidth feature is not supported on the device
25352  Remarks:
25353  None.
25354 */
25355 
25356 bool
25358  SPI_MODULE_ID index ) ;
25359 //******************************************************************************
25360 /* Function:
25361  PLIB_SPI_ExistsInputSamplePhase( SPI_MODULE_ID index )
25362  Summary:
25363  Identifies whether the InputSamplePhase feature exists on the SPI module.
25364  Description:
25365  This function identifies whether the InputSamplePhase feature is available
25366  on the SPI module.
25367  When this function returns true, this function is supported on the device:
25368  - PLIB_SPI_InputSamplePhaseSelect
25369  This operation is atomic.
25370  Preconditions:
25371  None.
25372  Parameters:
25373  index - Identifier for the device instance
25374  Returns:
25375  - true - The InputSamplePhase feature is supported on the device
25376  - false - The InputSamplePhase feature is not supported on the device
25377  Remarks:
25378  None.
25379 */
25380 
25381 bool
25383  SPI_MODULE_ID index ) ;
25384 //******************************************************************************
25385 /* Function:
25386  PLIB_SPI_ExistsOutputDataPhase( SPI_MODULE_ID index )
25387  Summary:
25388  Identifies whether the OutputDataPhase feature exists on the SPI module.
25389  Description:
25390  This function identifies whether the OutputDataPhase feature is available on
25391  the SPI module.
25392  When this function returns true, this function is supported on the device:
25393  - PLIB_SPI_OutputDataPhaseSelect
25394  This operation is atomic.
25395  Preconditions:
25396  None.
25397  Parameters:
25398  index - Identifier for the device instance
25399  Returns:
25400  - true - The OutputDataPhase feature is supported on the device
25401  - false - The OutputDataPhase feature is not supported on the device
25402  Remarks:
25403  None.
25404 */
25405 
25406 bool
25408  SPI_MODULE_ID index ) ;
25409 //******************************************************************************
25410 /* Function:
25411  PLIB_SPI_ExistsClockPolarity( SPI_MODULE_ID index )
25412  Summary:
25413  Identifies whether the ClockPolarity feature exists on the SPI module.
25414  Description:
25415  This function identifies whether the ClockPolarity feature is available on
25416  the SPI module.
25417  When this function returns true, this function is supported on the device:
25418  - PLIB_SPI_ClockPolaritySelect
25419  This operation is atomic.
25420  Preconditions:
25421  None.
25422  Parameters:
25423  index - Identifier for the device instance
25424  Returns:
25425  - true - The ClockPolarity feature is supported on the device
25426  - false - The ClockPolarity feature is not supported on the device
25427  Remarks:
25428  None.
25429 */
25430 
25431 bool
25433  SPI_MODULE_ID index ) ;
25434 //******************************************************************************
25435 /* Function:
25436  PLIB_SPI_ExistsMasterControl( SPI_MODULE_ID index )
25437  Summary:
25438  Identifies whether the MasterControl feature exists on the SPI module.
25439  Description:
25440  This function identifies whether the MasterControl feature is available on
25441  the SPI module.
25442  When this function returns true, these functions are supported on the device:
25443  - PLIB_SPI_MasterEnable
25444  - PLIB_SPI_SlaveEnable
25445  This operation is atomic.
25446  Preconditions:
25447  None.
25448  Parameters:
25449  index - Identifier for the device instance
25450  Returns:
25451  - true - The MasterControl feature is supported on the device
25452  - false - The MasterControl feature is not supported on the device
25453  Remarks:
25454  None.
25455 */
25456 
25457 bool
25459  SPI_MODULE_ID index ) ;
25460 //******************************************************************************
25461 /* Function:
25462  PLIB_SPI_ExistsBaudRate( SPI_MODULE_ID index )
25463  Summary:
25464  Identifies whether the BaudRate feature exists on the SPI module.
25465  Description:
25466  This function identifies whether the BaudRate feature is available on the SPI
25467  module.
25468  When this function returns true, this function is supported on the device:
25469  - PLIB_SPI_BaudRateSet
25470  This operation is atomic.
25471  Preconditions:
25472  None.
25473  Parameters:
25474  index - Identifier for the device instance
25475  Returns:
25476  - true - The BaudRate feature is supported on the device
25477  - false - The BaudRate feature is not supported on the device
25478  Remarks:
25479  None.
25480 */
25481 
25482 bool
25484  SPI_MODULE_ID index ) ;
25485 //******************************************************************************
25486 /* Function:
25487  PLIB_SPI_ExistsBusStatus( SPI_MODULE_ID index )
25488  Summary:
25489  Identifies whether the BusStatus feature exists on the SPI module.
25490  Description:
25491  This function identifies whether the BusStatus feature is available on the
25492  SPI module.
25493  When this function returns true, this function is supported on the device:
25494  - PLIB_SPI_IsBusy
25495  This operation is atomic.
25496  Preconditions:
25497  None.
25498  Parameters:
25499  index - Identifier for the device instance
25500  Returns:
25501  - true - The BusStatus feature is supported on the device
25502  - false - The BusStatus feature is not supported on the device
25503  Remarks:
25504  None.
25505 */
25506 
25507 bool
25509  SPI_MODULE_ID index ) ;
25510 //******************************************************************************
25511 /* Function:
25512  PLIB_SPI_ExistsReadDataSignStatus( SPI_MODULE_ID index )
25513  Summary:
25514  Identifies whether the ReadDataSignStatus feature exists on the SPI module.
25515  Description:
25516  This function identifies whether the ReadDataSignStatus feature is available
25517  on the SPI module.
25518  When this function returns true, this function is supported on the device:
25519  - PLIB_SPI_ReadDataIsSignExtended
25520  This operation is atomic.
25521  Preconditions:
25522  None.
25523  Parameters:
25524  index - Identifier for the device instance
25525  Returns:
25526  - true - The ReadDataSignStatus feature is supported on the device
25527  - false - The ReadDataSignStatus feature is not supported on the device
25528  Remarks:
25529  None.
25530 */
25531 
25532 bool
25534  SPI_MODULE_ID index ) ;
25535 //******************************************************************************
25536 /* Function:
25537  PLIB_SPI_ExistsSlaveSelectControl( SPI_MODULE_ID index )
25538  Summary:
25539  Identifies whether the SlaveSelectControl feature exists on the SPI module.
25540  Description:
25541  This function identifies whether the SlaveSelectControl feature is available
25542  on the SPI module.
25543  When this function returns true, these functions are supported on the device:
25544  - PLIB_SPI_SlaveSelectEnable
25545  - PLIB_SPI_SlaveSelectDisable
25546  This operation is atomic.
25547  Preconditions:
25548  None.
25549  Parameters:
25550  index - Identifier for the device instance
25551  Returns:
25552  - true - The SlaveSelectControl feature is supported on the device
25553  - false - The SlaveSelectControl feature is not supported on the device
25554  Remarks:
25555  None.
25556 */
25557 
25558 bool
25560  SPI_MODULE_ID index ) ;
25561 //******************************************************************************
25562 /* Function:
25563  PLIB_SPI_ExistsTransmitUnderRunStatus( SPI_MODULE_ID index )
25564  Summary:
25565  Identifies whether the TransmitUnderRunStatus feature exists on the SPI module.
25566  Description:
25567  This function identifies whether the TransmitUnderRunStatus feature is available
25568  on the SPI module.
25569  When this function returns true, these functions are supported on the device:
25570  - PLIB_SPI_TransmitUnderRunStatusGet
25571  - PLIB_SPI_TransmitUnderRunStatusClear
25572  This operation is atomic.
25573  Preconditions:
25574  None.
25575  Parameters:
25576  index - Identifier for the device instance
25577  Returns:
25578  - true - The TransmitUnderRunStatus feature is supported on the device
25579  - false - The TransmitUnderRunStatus feature is not supported on the device
25580  Remarks:
25581  None.
25582 */
25583 
25584 bool
25586  SPI_MODULE_ID index ) ;
25587 //******************************************************************************
25588 /* Function:
25589  PLIB_SPI_ExistsFIFOControl( SPI_MODULE_ID index )
25590  Summary:
25591  Identifies whether the FIFOControl feature exists on the SPI module.
25592  Description:
25593  This function identifies whether the FIFOControl feature is available on the
25594  SPI module.
25595  When this function returns true, these functions are supported on the device:
25596  - PLIB_SPI_FIFOEnable
25597  - PLIB_SPI_FIFODisable
25598  This operation is atomic.
25599  Preconditions:
25600  None.
25601  Parameters:
25602  index - Identifier for the device instance
25603  Returns:
25604  - true - The FIFOControl feature is supported on the device
25605  - false - The FIFOControl feature is not supported on the device
25606  Remarks:
25607  None.
25608 */
25609 
25610 bool
25612  SPI_MODULE_ID index ) ;
25613 //******************************************************************************
25614 /* Function:
25615  PLIB_SPI_ExistsFIFOCount( SPI_MODULE_ID index )
25616  Summary:
25617  Identifies whether the FIFOCount feature exists on the SPI module.
25618  Description:
25619  This function identifies whether the FIFOCount feature is available on the SPI module.
25620  When this function returns true, this function is supported on the device:
25621  - PLIB_SPI_FIFOCountGet
25622  This operation is atomic.
25623  Preconditions:
25624  None.
25625  Parameters:
25626  index - Identifier for the device instance
25627  Returns:
25628  - true - The FIFOCount feature is supported on the device
25629  - false - The FIFOCount feature is not supported on the device
25630  Remarks:
25631  None.
25632 */
25633 
25634 bool
25636  SPI_MODULE_ID index ) ;
25637 //******************************************************************************
25638 /* Function:
25639  PLIB_SPI_ExistsReceiveFIFOStatus( SPI_MODULE_ID index )
25640  Summary:
25641  Identifies whether the ReceiveFIFOStatus feature exists on the SPI module.
25642  Description:
25643  This function identifies whether the ReceiveFIFOStatus feature is available
25644  on the SPI module.
25645  When this function returns true, this function is supported on the device:
25646  - PLIB_SPI_ReceiverFIFOIsEmpty
25647  This operation is atomic.
25648  Preconditions:
25649  None.
25650  Parameters:
25651  index - Identifier for the device instance
25652  Returns:
25653  - true - The ReceiveFIFOStatus feature is supported on the device
25654  - false - The ReceiveFIFOStatus feature is not supported on the device
25655  Remarks:
25656  None.
25657 */
25658 
25659 bool
25661  SPI_MODULE_ID index ) ;
25662 //******************************************************************************
25663 /* Function:
25664  PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus( SPI_MODULE_ID index )
25665  Summary:
25666  Identifies whether the FIFOShiftRegisterEmptyStatus feature exists on the SPI module.
25667  Description:
25668  This function identifies whether the FIFOShiftRegisterEmptyStatus feature is
25669  available on the SPI module.
25670  When this function returns true, this function is supported on the device:
25671  - PLIB_SPI_FIFOShiftRegisterIsEmpty
25672  This operation is atomic.
25673  Preconditions:
25674  None.
25675  Parameters:
25676  index - Identifier for the device instance
25677  Returns:
25678  - true - The FIFOShiftRegisterEmptyStatus feature is supported on the device
25679  - false - The FIFOShiftRegisterEmptyStatus feature is not supported on the device
25680  Remarks:
25681  None.
25682 */
25683 
25684 bool
25686  SPI_MODULE_ID index ) ;
25687 //******************************************************************************
25688 /* Function:
25689  PLIB_SPI_ExistsFIFOInterruptMode( SPI_MODULE_ID index )
25690  Summary:
25691  Identifies whether the FIFOInterruptMode feature exists on the SPI module.
25692  Description:
25693  This function identifies whether the FIFOInterruptMode feature is available
25694  on the SPI module.
25695  When this function returns true, this function is supported on the device:
25696  - PLIB_SPI_FIFOInterruptModeSelect
25697  This operation is atomic.
25698  Preconditions:
25699  None.
25700  Parameters:
25701  index - Identifier for the device instance
25702  Returns:
25703  - true - The FIFOInterruptMode feature is supported on the device
25704  - false - The FIFOInterruptMode feature is not supported on the device
25705  Remarks:
25706  None.
25707 */
25708 
25709 bool
25711  SPI_MODULE_ID index ) ;
25712 //******************************************************************************
25713 /* Function:
25714  PLIB_SPI_ExistsFramedCommunication( SPI_MODULE_ID index )
25715  Summary:
25716  Identifies whether the FramedCommunication feature exists on the SPI module.
25717  Description:
25718  This function identifies whether the FramedCommunication feature is available
25719  on the SPI module.
25720  When this function returns true, these functions are supported on the device:
25721  - PLIB_SPI_FramedCommunicationEnable
25722  - PLIB_SPI_FramedCommunicationDisable
25723  This operation is atomic.
25724  Preconditions:
25725  None.
25726  Parameters:
25727  index - Identifier for the device instance
25728  Returns:
25729  - true - The FramedCommunication feature is supported on the device
25730  - false - The FramedCommunication feature is not supported on the device
25731  Remarks:
25732  None.
25733 */
25734 
25735 bool
25737  SPI_MODULE_ID index ) ;
25738 //******************************************************************************
25739 /* Function:
25740  PLIB_SPI_ExistsFrameSyncPulseDirection( SPI_MODULE_ID index )
25741  Summary:
25742  Identifies whether the FrameSyncPulseDirection feature exists on the SPI module.
25743  Description:
25744  This function identifies whether the FrameSyncPulseDirection feature is available
25745  on the SPI module.
25746  When this function returns true, this function is supported on the device:
25747  - PLIB_SPI_FrameSyncPulseDirectionSelect
25748  This operation is atomic.
25749  Preconditions:
25750  None.
25751  Parameters:
25752  index - Identifier for the device instance
25753  Returns:
25754  - true - The FrameSyncPulseDirection feature is supported on the device
25755  - false - The FrameSyncPulseDirection feature is not supported on the device
25756  Remarks:
25757  None.
25758 */
25759 
25760 bool
25762  SPI_MODULE_ID index ) ;
25763 //******************************************************************************
25764 /* Function:
25765  PLIB_SPI_ExistsFrameSyncPulsePolarity( SPI_MODULE_ID index )
25766  Summary:
25767  Identifies whether the FrameSyncPulsePolarity feature exists on the SPI module.
25768  Description:
25769  This function identifies whether the FrameSyncPulsePolarity feature is available
25770  on the SPI module.
25771  When this function returns true, this function is supported on the device:
25772  - PLIB_SPI_FrameSyncPulsePolaritySelect
25773  This operation is atomic.
25774  Preconditions:
25775  None.
25776  Parameters:
25777  index - Identifier for the device instance
25778  Returns:
25779  - true - The FrameSyncPulsePolarity feature is supported on the device
25780  - false - The FrameSyncPulsePolarity feature is not supported on the device
25781  Remarks:
25782  None.
25783 */
25784 
25785 bool
25787  SPI_MODULE_ID index ) ;
25788 //******************************************************************************
25789 /* Function:
25790  PLIB_SPI_ExistsFrameSyncPulseEdge( SPI_MODULE_ID index )
25791  Summary:
25792  Identifies whether the FrameSyncPulseEdge feature exists on the SPI module.
25793  Description:
25794  This function identifies whether the FrameSyncPulseEdge feature is available
25795  on the SPI module.
25796  When this function returns true, this function is supported on the device:
25797  - PLIB_SPI_FrameSyncPulseEdgeSelect
25798  This operation is atomic.
25799  Preconditions:
25800  None.
25801  Parameters:
25802  index - Identifier for the device instance
25803  Returns:
25804  - true - The FrameSyncPulseEdge feature is supported on the device
25805  - false - The FrameSyncPulseEdge feature is not supported on the device
25806  Remarks:
25807  None.
25808 */
25809 
25810 bool
25812  SPI_MODULE_ID index ) ;
25813 //******************************************************************************
25814 /* Function:
25815  PLIB_SPI_ExistsFrameSyncPulseWidth( SPI_MODULE_ID index )
25816  Summary:
25817  Identifies whether the FrameSyncPulseWidth feature exists on the SPI module.
25818  Description:
25819  This function identifies whether the FrameSyncPulseWidth feature is available
25820  on the SPI module.
25821  When this function returns true, this function is supported on the device:
25822  - PLIB_SPI_FrameSyncPulseWidthSelect
25823  This operation is atomic.
25824  Preconditions:
25825  None.
25826  Parameters:
25827  index - Identifier for the device instance
25828  Returns:
25829  - true - The FrameSyncPulseWidth feature is supported on the device
25830  - false - The FrameSyncPulseWidth feature is not supported on the device
25831  Remarks:
25832  None.
25833 */
25834 
25835 bool
25837  SPI_MODULE_ID index ) ;
25838 //******************************************************************************
25839 /* Function:
25840  PLIB_SPI_ExistsFrameSyncPulseCounter( SPI_MODULE_ID index )
25841  Summary:
25842  Identifies whether the FrameSyncPulseCounter feature exists on the SPI module.
25843  Description:
25844  This function identifies whether the FrameSyncPulseCounter feature is available
25845  on the SPI module.
25846  When this function returns true, this function is supported on the device:
25847  - PLIB_SPI_FrameSyncPulseCounterSelect
25848  This operation is atomic.
25849  Preconditions:
25850  None.
25851  Parameters:
25852  index - Identifier for the device instance
25853  Returns:
25854  - true - The FrameSyncPulseCounter feature is supported on the device
25855  - false - The FrameSyncPulseCounter feature is not supported on the device
25856  Remarks:
25857  None.
25858 */
25859 
25860 bool
25862  SPI_MODULE_ID index ) ;
25863 //******************************************************************************
25864 /* Function:
25865  PLIB_SPI_ExistsFrameErrorStatus( SPI_MODULE_ID index )
25866  Summary:
25867  Identifies whether the FrameErrorStatus feature exists on the SPI module.
25868  Description:
25869  This function identifies whether the FrameErrorStatus feature is available on
25870  the SPI module.
25871  When this function returns true, these functions are supported on the device:
25872  - PLIB_SPI_FrameErrorStatusGet
25873  - PLIB_SPI_FrameErrorStatusClear
25874  This operation is atomic.
25875  Preconditions:
25876  None.
25877  Parameters:
25878  index - Identifier for the device instance
25879  Returns:
25880  - true - The FrameErrorStatus feature is supported on the device
25881  - false - The FrameErrorStatus feature is not supported on the device
25882  Remarks:
25883  None.
25884 */
25885 
25886 bool
25888  SPI_MODULE_ID index ) ;
25889 //******************************************************************************
25890 /* Function:
25891  PLIB_SPI_ExistsBuffer( SPI_MODULE_ID index )
25892  Summary:
25893  Identifies whether the Buffer feature exists on the SPI module.
25894  Description:
25895  This function identifies whether the Buffer feature is available on the SPI module.
25896  When this function returns true, these functions are supported on the device:
25897  - PLIB_SPI_BufferClear
25898  - PLIB_SPI_BufferRead
25899  - PLIB_SPI_BufferWrite
25900  - PLIB_SPI_BufferAddressGet
25901  This operation is atomic.
25902  Preconditions:
25903  None.
25904  Parameters:
25905  index - Identifier for the device instance
25906  Returns:
25907  - true - The Buffer feature is supported on the device
25908  - false - The Buffer feature is not supported on the device
25909  Remarks:
25910  None.
25911 */
25912 
25913 bool
25915  SPI_MODULE_ID index ) ;
25916 //******************************************************************************
25917 /* Function:
25918  PLIB_SPI_ExistsBaudRateClock( SPI_MODULE_ID index )
25919  Summary:
25920  Identifies whether the BaudRateClock feature exists on the SPI module.
25921  Description:
25922  This function identifies whether the BaudRateClock feature is available on
25923  the SPI module.
25924  When this function returns true, this function is supported on the device:
25925  - PLIB_SPI_BaudRateClockSelect
25926  This operation is atomic.
25927  Preconditions:
25928  None.
25929  Parameters:
25930  index - Identifier for the device instance
25931  Returns:
25932  - true - The BaudRateClock feature is supported on the device
25933  - false - The BaudRateClock feature is not supported on the device
25934  Remarks:
25935  None.
25936 */
25937 
25938 bool
25940  SPI_MODULE_ID index ) ;
25941 //******************************************************************************
25942 /* Function:
25943  PLIB_SPI_ExistsErrorInterruptControl( SPI_MODULE_ID index )
25944  Summary:
25945  Identifies whether the ErrorInterruptControl feature exists on the SPI module.
25946  Description:
25947  This function identifies whether the ErrorInterruptControl feature is available
25948  on the SPI module.
25949  When this function returns true, these functions are supported on the device:
25950  - PLIB_SPI_ErrorInterruptEnable
25951  - PLIB_SPI_ErrorInterruptDisable
25952  This operation is atomic.
25953  Preconditions:
25954  None.
25955  Parameters:
25956  index - Identifier for the device instance
25957  Returns:
25958  - true - The ErrorInterruptControl feature is supported on the device
25959  - false - The ErrorInterruptControl feature is not supported on the device
25960  Remarks:
25961  None.
25962 */
25963 
25964 bool
25966  SPI_MODULE_ID index ) ;
25967 //******************************************************************************
25968 /* Function:
25969  PLIB_SPI_ExistsAudioErrorControl( SPI_MODULE_ID index )
25970  Summary:
25971  Identifies whether the AudioErrorControl feature exists on the SPI module.
25972  Description:
25973  This function identifies whether the AudioErrorControl feature is available
25974  on the SPI module.
25975  When this function returns true, these functions are supported on the device:
25976  - PLIB_SPI_AudioErrorEnable
25977  - PLIB_SPI_AudioErrorDisable
25978  This operation is atomic.
25979  Preconditions:
25980  None.
25981  Parameters:
25982  index - Identifier for the device instance
25983  Returns:
25984  - true - The AudioErrorControl feature is supported on the device
25985  - false - The AudioErrorControl feature is not supported on the device
25986  Remarks:
25987  None.
25988 */
25989 
25990 bool
25992  SPI_MODULE_ID index ) ;
25993 //******************************************************************************
25994 /* Function:
25995  PLIB_SPI_ExistsAudioProtocolControl( SPI_MODULE_ID index )
25996  Summary:
25997  Identifies whether the AudioProtocolControl feature exists on the SPI module.
25998  Description:
25999  This function identifies whether the AudioProtocolControl feature is available
26000  on the SPI module.
26001  When this function returns true, this function is supported on the device:
26002  - PLIB_SPI_AudioProtocolEnable
26003  - PLIB_SPI_AudioProtocolDisable
26004  This operation is atomic.
26005  Preconditions:
26006  None.
26007  Parameters:
26008  index - Identifier for the device instance
26009  Returns:
26010  - true - The AudioProtocolControl feature is supported on the device
26011  - false - The AudioProtocolControl feature is not supported on the device
26012  Remarks:
26013  None.
26014 */
26015 
26016 bool
26018  SPI_MODULE_ID index ) ;
26019 //******************************************************************************
26020 /* Function:
26021  PLIB_SPI_ExistsAudioTransmitMode( SPI_MODULE_ID index )
26022  Summary:
26023  Identifies whether the AudioTransmitMode feature exists on the SPI module.
26024  Description:
26025  This function identifies whether the AudioTransmitMode feature is available
26026  on the SPI module.
26027  When this function returns true, this function is supported on the device:
26028  - PLIB_SPI_AudioTransmitModeSelect
26029  This operation is atomic.
26030  Preconditions:
26031  None.
26032  Parameters:
26033  index - Identifier for the device instance
26034  Returns:
26035  - true - The AudioTransmitMode feature is supported on the device
26036  - false - The AudioTransmitMode feature is not supported on the device
26037  Remarks:
26038  None.
26039 */
26040 
26041 bool
26043  SPI_MODULE_ID index ) ;
26044 //******************************************************************************
26045 /* Function:
26046  PLIB_SPI_ExistsAudioProtocolMode( SPI_MODULE_ID index )
26047  Summary:
26048  Identifies whether the AudioProtocolMode feature exists on the SPI module.
26049  Description:
26050  This function identifies whether the AudioProtocolMode feature is available
26051  on the SPI module.
26052  When this function returns true, this function is supported on the device:
26053  - PLIB_SPI_AudioProtocolModeSelect
26054  This operation is atomic.
26055  Preconditions:
26056  None.
26057  Parameters:
26058  index - Identifier for the device instance
26059  Returns:
26060  - true - The AudioProtocolMode feature is supported on the device
26061  - false - The AudioProtocolMode feature is not supported on the device
26062  Remarks:
26063  None.
26064 */
26065 
26066 bool
26068  SPI_MODULE_ID index ) ;
26069 //******************************************************************************
26070 /* Function:
26071  PLIB_SPI_Exists32bitBuffer( SPI_MODULE_ID index )
26072  Summary:
26073  Identifies whether the Buffer32bit feature exists on the SPI module.
26074  Description:
26075  This function identifies whether the Buffer32bit feature is available on the
26076  SPI module.
26077  When this function returns true, these functions are supported on the device:
26078  - PLIB_SPI_BufferRead32bit
26079  - PLIB_SPI_BufferWrite32bit
26080  This operation is atomic.
26081  Preconditions:
26082  None.
26083  Parameters:
26084  index - Identifier for the device instance
26085  Returns:
26086  - true - The Buffer32bit feature is supported on the device
26087  - false - The Buffer32bit feature is not supported on the device
26088  Remarks:
26089  None.
26090 */
26091 
26092 bool
26094  SPI_MODULE_ID index ) ;
26095 //******************************************************************************
26096 /* Function:
26097  PLIB_SPI_Exists16bitBuffer( SPI_MODULE_ID index )
26098  Summary:
26099  Identifies whether the Buffer16bit feature exists on the SPI module.
26100  Description:
26101  This function identifies whether the Buffer16bit feature is available on the
26102  SPI module.
26103  When this function returns true, these functions are supported on the device:
26104  - PLIB_SPI_BufferRead16bit
26105  - PLIB_SPI_BufferWrite16bit
26106  This operation is atomic.
26107  Preconditions:
26108  None.
26109  Parameters:
26110  index - Identifier for the device instance
26111  Returns:
26112  - true - The Buffer16bit feature is supported on the device
26113  - false - The Buffer16bit feature is not supported on the device
26114  Remarks:
26115  None.
26116 */
26117 
26118 bool
26120  SPI_MODULE_ID index ) ;
26121 //DOM-IGNORE-BEGIN
26122 //DOM-IGNORE-END
26123  // #ifndef _PLIB_SPI_H
26124 /*******************************************************************************
26125  End of File
26126  */
26127 
26128 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h*/
26129 /* CLOSE_FILE Include File */
26130 
26131  // SPI PLIB Header
26132 #include "system/common/sys_common.h" // Common System Service Definitions
26133 #include "system/common/sys_module.h" // Module/Driver Definitions
26134 #include "system/int/sys_int.h" // System Interrupt Definitions
26135 #include "system/clk/sys_clk.h"
26136 #include "C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h"
26137  /* LDRA full path */
26138 // DOM-IGNORE-BEGIN
26139 // DOM-IGNORE-END
26140 // *****************************************************************************
26141 /* SPI Driver Buffer Handle
26142  Summary:
26143  Handle identifying a read or write buffer passed to the driver.
26144  Description:
26145  A buffer handle value is returned by a call to the DRV_SPI_BufferAddRead()/
26146  DRV_SPI_BufferAddWrite or DRV_SPI_BufferAddReadWrite() functions.
26147  This handle is associated with the buffer passed into the function and
26148  it allows the application to track the completion of the data from (or into)
26149  that buffer. The buffer handle value returned from the "buffer add" function
26150  is returned back to the client by the "callback" function registered with
26151  the driver.
26152  The buffer handle assigned to a client request expires when the client has
26153  been notified of the completion of the buffer transfer (after event handler
26154  function that notifies the client returns) or after the buffer has been
26155  retired by the driver if no event handler callback was set.
26156  Remarks:
26157  None.
26158 */
26159 
26160 typedef
26161 uintptr_t
26163 // *****************************************************************************
26164 /* SPI Driver Invalid Buffer Handle
26165  Summary:
26166  Definition of an invalid buffer handle.
26167  Description:
26168  This is the definition of an invalid buffer handle. An invalid buffer handle
26169  is returned by DRV_SPI_BufferAddRead() and DRV_SPI_BufferAddWrite()
26170  function if the buffer add request was not successful.
26171  Remarks:
26172  None.
26173 */
26174 #define DRV_SPI_BUFFER_HANDLE_INVALID ( ( DRV_SPI_BUFFER_HANDLE ) ( - 1 ) )
26175 // *****************************************************************************
26176 /* SPI Driver Module Index Numbers
26177  Summary:
26178  SPI driver index definitions.
26179  Description:
26180  These constants provide the SPI driver index definitions.
26181  Remarks:
26182  These constants should be used in place of hard-coded numeric literals.
26183  These values should be passed into the DRV_SPI_Initialize and
26184  DRV_SPI_Open functions to identify the driver instance in use.
26185 */
26186 #define DRV_SPI_INDEX_0 0
26187 #define DRV_SPI_INDEX_1 1
26188 #define DRV_SPI_INDEX_2 2
26189 #define DRV_SPI_INDEX_3 3
26190 #define DRV_SPI_INDEX_4 4
26191 #define DRV_SPI_INDEX_5 5
26192 // *****************************************************************************
26193 /* SPI Driver Module Index Count
26194  Summary:
26195  Number of valid SPI driver indices.
26196  Description:
26197  This constant identifies the number of valid SPI driver indices.
26198  Remarks:
26199  This constant should be used in place of hard-coded numeric literals.
26200  This value is derived from device-specific header files defined as part
26201  of the peripheral libraries.
26202 */
26203 #define DRV_SPI_INDEX_COUNT SPI_NUMBER_OF_MODULES
26204 // *****************************************************************************
26205 /* SPI Clock Mode Selection
26206  Summary:
26207  Identifies the various clock modes of the SPI module.
26208  Description:
26209  This enumeration identifies the various clock modes of the SPI module.
26210  Remarks:
26211  None.
26212 */
26213 
26214 typedef
26215  enum
26216  {
26217  /* SPI Clock Mode 0:
26218  - Idle State of the clock is Low
26219  - Serial Output Data (SDO) Changed on Rising Edge of the clock
26220  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26222  /*DOM-IGNORE-BEGIN*/
26223  = 0 /*DOM-IGNORE-END*/
26224  ,
26225  /* SPI Clock Mode 1:
26226  - Idle State of the clock is Low
26227  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26228  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26230  /*DOM-IGNORE-BEGIN*/
26231  = 1 /*DOM-IGNORE-END*/
26232  ,
26233  /* SPI Clock Mode 2:
26234  - Idle State of the clock is High
26235  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26236  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26238  /*DOM-IGNORE-BEGIN*/
26239  = 2 /*DOM-IGNORE-END*/
26240  ,
26241  /* SPI Clock Mode 3:
26242  - Idle State of the clock is High
26243  - Serial Output Data (SDO) Changes on Rising Edge of the clock
26244  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26246  /*DOM-IGNORE-BEGIN*/
26247  = 3 /*DOM-IGNORE-END*/
26248  } DRV_SPI_CLOCK_MODE ;
26249 // *****************************************************************************
26250 /* SPI Buffer Type Selection
26251  Summary:
26252  Identifies the various buffer types of the SPI module.
26253  Description:
26254  This enumeration identifies the various buffer types of the SPI module.
26255  Remarks:
26256  None.
26257 */
26258 
26259 typedef
26260  enum
26261  {
26262  /* SPI Buffer Type Standard */
26264  /*DOM-IGNORE-BEGIN*/
26265  = 0 /*DOM-IGNORE-END*/
26266  ,
26267  /* SPI Enhanced Buffer Type */
26269  /*DOM-IGNORE-BEGIN*/
26270  = 1 /*DOM-IGNORE-END*/
26272 // *****************************************************************************
26273 /* SPI Protocols Enumeration
26274  Summary:
26275  Identifies the various protocols of the SPI module.
26276  Description:
26277  This enumeration identifies the various protocols of the SPI module.
26278  Remarks:
26279  None.
26280 */
26281 
26282 typedef
26283  enum
26284  {
26285  /* SPI Protocol Type Standard */
26287  /*DOM-IGNORE-BEGIN*/
26288  = 0 /*DOM-IGNORE-END*/
26289  ,
26290  /* SPI Protocol Type Framed */
26292  /*DOM-IGNORE-BEGIN*/
26293  = 1 /*DOM-IGNORE-END*/
26294  ,
26295  /*SPI Protocol Type Audio*/
26297  /*DOM-IGNORE-BEGIN*/
26298  = 2 /*DOM-IGNORE-END*/
26300 // *****************************************************************************
26301 /* SPI Driver Buffer Events
26302  Summary
26303  Identifies the possible events that can result from a buffer add request.
26304  Description
26305  This enumeration identifies the possible events that can result from a
26306  buffer add request caused by the client calling either
26307  DRV_SPI_BufferAddRead2 or DRV_SPI_BufferAddWrite2 or similar functions.
26308  Remarks:
26309  One of these values is passed in the "event" parameter of the event
26310  handling callback function that the client registered during buffer add
26311  requests.
26312 */
26313 
26314 typedef
26315  enum
26316  {
26317  /* Buffer is pending to get processed */
26319  /* Buffer is being processed */
26321  /* All data from or to the buffer was transferred successfully. */
26323  /* There was an error while processing the buffer transfer request. */
26326 // *****************************************************************************
26327 /* SPI Usage Modes Enumeration
26328  Summary:
26329  Identifies the various usage modes of the SPI module.
26330  Description:
26331  This enumeration identifies the various usage modes of the SPI module.
26332  Remarks:
26333  None.
26334 */
26335 
26336 typedef
26337  enum
26338  {
26339  /* SPI Mode Master */
26341  /*DOM-IGNORE-BEGIN*/
26342  = 0 /*DOM-IGNORE-END*/
26343  ,
26344  /* SPI Mode Slave */
26346  /*DOM-IGNORE-BEGIN*/
26347  = 1 /*DOM-IGNORE-END*/
26348  } DRV_SPI_MODE ;
26349 // *****************************************************************************
26350 /* SPI Task Modes Enumeration
26351  Summary:
26352  Identifies the various modes of how the tasks function will be run.
26353  Description:
26354  This enumeration identifies the various tasks mode
26355  Remarks:
26356  None.
26357 */
26358 
26359 typedef
26360  enum
26361  {
26362  /* Task is configured to run in polled mode */
26364  /*DOM-IGNORE-BEGIN*/
26365  = 0 /*DOM-IGNORE-END*/
26366  ,
26367  /* Task is configured to run in interrupt mode */
26369  /*DOM-IGNORE-BEGIN*/
26370  = 1 /*DOM-IGNORE-END*/
26371  } DRV_SPI_TASK_MODE ;
26372 // *****************************************************************************
26373 /* SPI Driver Buffer Event Handler Function Pointer
26374  Summary:
26375  Pointer to a SPI Driver Buffer Event handler function
26376  Description:
26377  This data type defines the required function signature for the SPI driver
26378  buffer event handling callback function. A client must register a pointer
26379  to a buffer event handling function who's function signature (parameter
26380  and return value types) match the types specified by this function pointer
26381  in order to receive buffer related event calls back from the driver.
26382  The parameters and return values and return value are described here and
26383  a partial example implementation is provided.
26384  Parameters:
26385  event - Identifies the type of event
26386  bufferHandle - Handle identifying the buffer to which the vent relates
26387  context - Value identifying the context of the application that
26388  registered the event handling function.
26389  Returns:
26390  None.
26391  Example:
26392  <code>
26393  void APP_MyBufferEventHandler( DRV_SPI_BUFFER_EVENT event,
26394  DRV_SPI_BUFFER_HANDLE bufferHandle,
26395  uintptr_t context )
26396  {
26397  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
26398  switch(event)
26399  {
26400  case DRV_SPI_BUFFER_EVENT_COMPLETE:
26401  // Handle the completed buffer.
26402  break;
26403  case DRV_SPI_BUFFER_EVENT_ERROR:
26404  default:
26405  // Handle error.
26406  break;
26407  }
26408  }
26409  </code>
26410  Remarks:
26411  If the event is DRV_SPI_BUFFER_EVENT_COMPLETE, it means that the data was
26412  transferred successfully.
26413  If the event is DRV_SPI_BUFFER_EVENT_ERROR, it means that the data was
26414  not transferred successfully.
26415  The bufferHandle parameter contains the buffer handle of the buffer that
26416  failed.
26417  The context parameter contains the a handle to the client context,
26418  provided at the time the event handling function registration.
26419  This context handle value is passed back to the client as the "context"
26420  parameter. It can be any value necessary to identify the client context
26421  or instance (such as a pointer to the client's data) instance of the
26422  client that made the buffer add request.
26423  The event handler function executes in an interrupt context when the driver
26424  is configured for interrupt mode operation. It is recommended of the
26425  application to not perform process intensive operations with in this
26426  function.
26427 */
26428 
26429 typedef
26431 DRV_SPI_BUFFER_HANDLE bufferHandle ,
26432 void * context ) ;
26433 // *****************************************************************************
26434 /* SPI Driver Initialization Data
26435  Summary:
26436  Defines the data required to initialize or reinitialize the SPI driver
26437  Description:
26438  This data type defines the data required to initialize or reinitialize the
26439  SPI driver. If the driver is built statically, the members of this data
26440  structure are statically over-ridden by static override definitions in the
26441  system_config.h file.
26442  Remarks:
26443  None.
26444 */
26445 
26446 typedef
26447 struct _DRV_SPI_INIT
26448 {
26449  /* System module initialization */
26450  SYS_MODULE_INIT moduleInit ;
26451  /* Identifies peripheral (PLIB-level) ID */
26452  SPI_MODULE_ID spiId ;
26453  /* SPI Task Mode Type*/
26455  /* SPI Usage Mode Type */
26457  /* Allow SPI to run when CPU goes to idle mode*/
26458  bool allowIdleRun ;
26459  /* SPI Protocol Type */
26461  /* SPI Slave Mode SSx Pin Select */
26462  bool spiSlaveSSPin ;
26463  /* Framed mode Sync Pulse*/
26464  SPI_FRAME_SYNC_PULSE frameSyncPulse ;
26465  /* Framed Mode pulse polarity*/
26466  SPI_FRAME_PULSE_POLARITY framePulsePolarity ;
26467  /* Framed Mode Pulse Direction*/
26468  SPI_FRAME_PULSE_DIRECTION framePulseDirection ;
26469  /* Framed mode Pulse Edge*/
26470  SPI_FRAME_PULSE_EDGE framePulseEdge ;
26471  /* Framed Mode Pulse width */
26472  SPI_FRAME_PULSE_WIDTH framePulseWidth ;
26473  /* Audio mode transmit mode*/
26474  SPI_AUDIO_TRANSMIT_MODE audioTransmitMode ;
26475  /* Audio mode protocol mode*/
26476  SPI_AUDIO_PROTOCOL audioProtocolMode ;
26477  /* Communication Width */
26478  SPI_COMMUNICATION_WIDTH commWidth ;
26479  /* SPI clock source which generates required baud rate.
26480  It can be either PBCLK or Reference Clock */
26481  SPI_BAUD_RATE_CLOCK baudClockSource ;
26482  /* when Baud rate clock source is peripheral clock, then this element is
26483  used to define which peripheral bus clock is used for this particular
26484  SPI instance. */
26485  CLK_BUSES_PERIPHERAL spiClk ;
26486  /* Baud Rate Value */
26487  uint32_t baudRate ;
26488  /* SPI Buffer Type */
26490  /* SPI Clock mode */
26492  /* SPI Input Sample Phase Selection */
26493  SPI_INPUT_SAMPLING_PHASE inputSamplePhase ;
26494  /* Transmit/Receive or Transmit Interrupt Source for SPI module */
26495  INT_SOURCE txInterruptSource ;
26496  /* Receive Interrupt Source for SPI module */
26497  INT_SOURCE rxInterruptSource ;
26498  /* Error Interrupt Source for SPI module */
26499  INT_SOURCE errInterruptSource ;
26500  /* While using standard buffer and polled mode how many transfers to do
26501  before yielding to other tasks*/
26502  uint8_t numTrfsSmPolled ;
26503  /* Dummy byte value which will be used for dummy transmission */
26504  uint32_t dummyByteValue ;
26505  /* This is the buffer queue size. This is the maximum
26506  number of transfer requests that driver will queue. */
26507  uint8_t queueSize ;
26508  /* This controls the minimum number of jobs that the driver will be able
26509  to accept without running out of memory. The driver will reserve this
26510  number of jobs from the global SPI queue so that it will always be available*/
26511  uint8_t jobQueueReserveSize ;
26512  /* This callback is fired when an operation is about to start on the
26513  SPI bus. This allows the user to set any pins that need to be set.
26514  This callback may be called from an ISR so should not include OSAL
26515  calls. The context parameter is the same one passed into the
26516  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26517  */
26519  /* This callback is fired when an operation has just completed on the
26520  SPI bus. This allows the user to set any pins that need to be set.
26521  This callback may be called from an ISR so should not include OSAL
26522  calls. The context parameter is the same one passed into the
26523  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26524  */
26526 } DRV_SPI_INIT ;
26527 // *****************************************************************************
26528 /* SPI Driver Client Specific Configuration
26529  Summary:
26530  Defines the data that can be changed per client.
26531  Description:
26532  This data type defines the data can be configured per client. This data can
26533  be per client, and overrides the configuration data contained inside of
26534  DRV_SPI_INIT.
26535  Remarks:
26536  None.
26537 */
26538 
26539 typedef
26540 struct _DRV_SPI_CLIENT_DATA
26541 {
26542  /* Baud Rate Value */
26543  uint32_t baudRate ;
26544  /* This callback is fired when an operation is about to start on the
26545  SPI bus. This allows the user to set any pins that need to be set.
26546  This callback may be called from an ISR so should not include OSAL
26547  calls. The context parameter is the same one passed into the
26548  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26549  */
26551  /* This callback is fired when an operation has just completed on the
26552  SPI bus. This allows the user to set any pins that need to be set.
26553  This callback may be called from an ISR so should not include OSAL
26554  calls. The context parameter is the same one passed into the
26555  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26556  */
26559 //DOM-IGNORE-BEGIN
26560 //DOM-IGNORE-END
26561  // #ifndef _DRV_SPI_DEFINITIONS_H
26562 /*******************************************************************************
26563  End of File
26564 */
26565 
26566 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h*/
26567 /* CLOSE_FILE Include File */
26568 
26569 // DOM-IGNORE-BEGIN
26570 // DOM-IGNORE-END
26571 // *****************************************************************************
26572 // *****************************************************************************
26573 // Section: Interface Routines - System Level
26574 // *****************************************************************************
26575 // *****************************************************************************
26576 // *****************************************************************************
26577 /* Function:
26578  SYS_MODULE_OBJ DRV_SPI_Initialize( const SYS_MODULE_INDEX index,
26579  const SYS_MODULE_INIT * const init )
26580  Summary:
26581  Initializes the SPI instance for the specified driver index.
26582  <p><b>Implementation:</b> Static/Dynamic</p>
26583  Description:
26584  This routine initializes the SPI driver instance for the specified driver
26585  index, making it ready for clients to open and use it. The initialization
26586  data is specified by the 'init' parameter. The initialization may fail if the
26587  number of driver objects allocated are insufficient or if the specified
26588  driver instance is already initialized. The driver instance index is
26589  independent of the SPI module ID. For example, driver instance 0 can be
26590  assigned to SPI2. If the driver is built statically, then some of the
26591  initialization parameters are overridden by configuration macros. Refer to
26592  the description of the DRV_SPI_INIT data structure for more details on
26593  which members on this data structure are overridden.
26594  Precondition:
26595  None.
26596  Parameters:
26597  index - Identifier for the instance to be initialized. Please note this
26598  is not the SPI id. The hardware SPI id is set in the initialization
26599  structure. This is the index of the driver index to use.
26600  init - Pointer to a data structure containing any data necessary to
26601  initialize the driver. If this pointer is NULL, the driver
26602  uses the static initialization override macros for each
26603  member of the initialization data structure.
26604  Returns:
26605  - If successful - returns a valid handle to a driver instance object
26606  - If unsuccessful - returns SYS_MODULE_OBJ_INVALID
26607  Example:
26608  <code>
26609  DRV_SPI_INIT init;
26610  SYS_MODULE_OBJ objectHandle;
26611  // Populate the SPI initialization structure
26612  init.spiId = SPI_ID_1,
26613  init.taskMode = DRV_SPI_TASK_MODE_ISR,
26614  init.spiMode = DRV_SPI_MODE_MASTER,
26615  init.allowIdleRun = false,
26616  init.spiProtocolType = DRV_SPI_PROTOCOL_TYPE_STANDARD,
26617  init.commWidth = SPI_COMMUNICATION_WIDTH_8BITS,
26618  init.baudClockSource = SPI_BAUD_RATE_PBCLK_CLOCK;
26619  init.spiClk = CLK_BUS_PERIPHERAL_2,
26620  init.baudRate = 10000000,
26621  init.bufferType = DRV_SPI_BUFFER_TYPE_ENHANCED,
26622  init.clockMode = DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL,
26623  init.inputSamplePhase = SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE,
26624  init.txInterruptSource = INT_SOURCE_SPI_1_TRANSMIT,
26625  init.rxInterruptSource = INT_SOURCE_SPI_1_RECEIVE,
26626  init.errInterruptSource = INT_SOURCE_SPI_1_ERROR,
26627  init.dummyByteValue = 0xFF,
26628  init.queueSize = 10,
26629  init.jobQueueReserveSize = 1,
26630  objectHandle = DRV_SPI_Initialize(DRV_SPI_INDEX_1, (SYS_MODULE_INIT*)usartInitData);
26631  if (SYS_MODULE_OBJ_INVALID == objectHandle)
26632  {
26633  // Handle error
26634  }
26635  </code>
26636  Remarks:
26637  This routine must be called before any other SPI routine is called.
26638  This routine should only be called once during system initialization
26639  unless DRV_SPI_Deinitialize is called to deinitialize the driver
26640  instance. This routine will NEVER block for hardware access.
26641 */
26642 
26643 SYS_MODULE_OBJ
26645  const SYS_MODULE_INDEX index ,
26646  const SYS_MODULE_INIT * const init ) ;
26647 //*************************************************************************
26648 /* Function:
26649  void DRV_SPI_Deinitialize ( SYS_MODULE_OBJ object )
26650  Summary:
26651  Deinitializes the specified instance of the SPI driver module.
26652  <p><b>Implementation:</b> Static/Dynamic</p>
26653  Description:
26654  Deinitializes the specified instance of the SPI driver module,
26655  disabling its operation (and any hardware) and invalidates all of the
26656  internal data.
26657  Precondition:
26658  Function DRV_SPI_Initialize must have been called before calling this
26659  routine and a valid SYS_MODULE_OBJ must have been returned.
26660  Parameters:
26661  object - Driver object handle, returned from DRV_SPI_Initialize
26662  Returns:
26663  None.
26664  Example:
26665  <code>
26666  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26667  SYS_STATUS status;
26668  DRV_SPI_Deinitialize ( object );
26669  status = DRV_SPI_Status( object );
26670  if( SYS_MODULE_UNINITIALIZED == status )
26671  {
26672  // Check again later if you need to know
26673  // when the driver is deinitialized.
26674  }
26675  </code>
26676  Remarks:
26677  Once the Initialize operation has been called, the De-initialize
26678  operation must be called before the Initialize operation can be called
26679  again.
26680  This function will NEVER block waiting for hardware. If the operation
26681  requires time to allow the hardware to complete, this will be reported
26682  by the DRV_SPI_Status operation. The system has to use DRV_SPI_Status
26683  to find out when the module is in the ready state.
26684 */
26685 
26686 void
26688  SYS_MODULE_OBJ object ) ;
26689 //**************************************************************************
26690 /* Function:
26691  SYS_STATUS DRV_SPI_Status ( SYS_MODULE_OBJ object )
26692  Summary:
26693  Provides the current status of the SPI driver module.
26694  <p><b>Implementation:</b> Static/Dynamic</p>
26695  Description:
26696  This function provides the current status of the SPI driver module.
26697  Precondition:
26698  The DRV_SPI_Initialize function must have been called before calling
26699  this function.
26700  Parameters:
26701  object - Driver object handle, returned from DRV_SPI_Initialize
26702  Returns:
26703  - SYS_STATUS_READY - Indicates that the driver is busy with a previous
26704  system level operation and cannot start another
26705  Example:
26706  <code>
26707  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26708  SYS_STATUS status;
26709  status = DRV_SPI_Status( object );
26710  if( SYS_STATUS_READY != status )
26711  {
26712  // Handle error
26713  }
26714  </code>
26715  Remarks:
26716  Any value greater than SYS_STATUS_READY is also a normal running state
26717  in which the driver is ready to accept new operations.
26718  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been
26719  deinitialized
26720  This value is less than SYS_STATUS_ERROR.
26721  This function can be used to determine when any of the driver's module
26722  level operations has completed.
26723  If the status operation returns SYS_STATUS_BUSY, the previous operation
26724  has not yet completed. Once the status operation returns
26725  SYS_STATUS_READY, any previous operations have completed.
26726  The value of SYS_STATUS_ERROR is negative (-1). Any value less than
26727  that is also an error state.
26728  This function will NEVER block waiting for hardware.
26729  If the Status operation returns an error value, the error may be
26730  cleared by calling the reinitialize operation. If that fails, the
26731  deinitialize operation will need to be called, followed by the
26732  initialize operation to return to normal operations.
26733 */
26734 
26735 SYS_STATUS
26736  DRV_SPI_Status (
26737  SYS_MODULE_OBJ object ) ;
26738 // *****************************************************************************
26739 /* Function:
26740  void DRV_SPI_Tasks ( SYS_MODULE_OBJ object );
26741  Summary:
26742  Maintains the driver's state machine and implements its ISR.
26743  <p><b>Implementation:</b> Static/Dynamic</p>
26744  Description:
26745  This routine is used to maintain the driver's internal state
26746  machine and implement its transmit ISR for interrupt-driven implementations.
26747  In polling mode, this function should be called from the SYS_Tasks()
26748  function. In interrupt mode, this function should be called in the transmit
26749  interrupt service routine of the USART that is associated with this USART
26750  driver hardware instance.
26751  Precondition:
26752  The DRV_SPI_Initialize routine must have been called for the specified
26753  SPI driver instance.
26754  Parameters:
26755  object - Object handle for the specified driver instance (returned from
26756  DRV_SPI_Initialize)
26757  Returns:
26758  None.
26759  Example:
26760  <code>
26761  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26762  while( true )
26763  {
26764  DRV_SPI_Tasks ( object );
26765  // Do other tasks
26766  }
26767  </code>
26768  Remarks:
26769  This function is normally not called directly by an application. It is
26770  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
26771  ISR.
26772  This function may execute in an ISR context and will never block or access any
26773  resources that may cause it to block.
26774 */
26775 
26776 void
26777  DRV_SPI_Tasks (
26778  SYS_MODULE_OBJ object ) ;
26779 // *****************************************************************************
26780 // *****************************************************************************
26781 // Section: Interface Routines - Client Level
26782 // *****************************************************************************
26783 // *****************************************************************************
26784 //**************************************************************************
26785 /* Function:
26786  DRV_HANDLE DRV_SPI_Open ( const SYS_MODULE_INDEX drvIndex,
26787  const DRV_IO_INTENT ioIntent )
26788  Summary:
26789  Opens the specified SPI driver instance and returns a handle to it.
26790  <p><b>Implementation:</b> Static/Dynamic</p>
26791  Description:
26792  This routine opens the specified SPI driver instance and provides a
26793  handle that must be provided to all other client-level operations to
26794  identify the caller and the instance of the driver. The ioIntent
26795  parameter defines how the client interacts with this driver instance.
26796  If ioIntent is DRV_IO_INTENT_READ, the client will only be read from
26797  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be
26798  able to write to the driver. If the ioIntent in
26799  DRV_IO_INTENT_READWRITE, the client will be able to do both, read and
26800  write.
26801  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
26802  exclusive access to this client. The driver cannot be opened by any
26803  other client.
26804  Precondition:
26805  The DRV_SPI_Initialize function must have been called before calling
26806  this function.
26807  Parameters:
26808  drvIndex - Index of the driver initialized with DRV_SPI_Initialize().
26809  Please note this is not the SPI ID.
26810  ioIntent - Zero or more of the values from the enumeration
26811  DRV_IO_INTENT ORed together to indicate the intended use of
26812  the driver
26813  Returns:
26814  If successful, the routine returns a valid open-instance handle (a
26815  number identifying both the caller and the module instance).
26816  If an error occurs, the return value is DRV_HANDLE_INVALID. An error
26817  can occur when the following is true:
26818  * if the number of client objects allocated via
26819  DRV_SPI_INSTANCES_NUMBER is insufficient
26820  * if the client is trying to open the driver but driver has been
26821  opened exclusively by another client
26822  * if the driver hardware instance being opened is not initialized or
26823  is invalid
26824  Example:
26825  <code>
26826  DRV_HANDLE handle;
26827  handle = DRV_SPI_Open( DRV_SPI_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
26828  if( DRV_HANDLE_INVALID == handle )
26829  {
26830  // Unable to open the driver
26831  }
26832  </code>
26833  Remarks:
26834  The handle returned is valid until the DRV_SPI_Close routine is
26835  called. This routine will NEVER block waiting for hardware. If the
26836  requested intent flags are not supported, the routine will return
26837  DRV_HANDLE_INVALID. This function is thread safe in a RTOS application.
26838  It should not be called in an ISR.
26839 */
26840 
26841 DRV_HANDLE
26842  DRV_SPI_Open (
26843  const SYS_MODULE_INDEX drvIndex ,
26844  const DRV_IO_INTENT ioIntent ) ;
26845 //**************************************************************************
26846 /* Function:
26847  int32_t DRV_SPI_ClientConfigure ( DRV_HANDLE handle,
26848  const DRV_SPI_CLIENT_DATA * cfgData )
26849  Summary:
26850  Configures a SPI client with specific data.
26851  <p><b>Implementation:</b> Static/Dynamic</p>
26852  Description:
26853  This routine takes a DRV_SPI_CLIENT_DATA structure and sets client specific options.
26854  Whenever a new SPI job is started these values will be used. Passing in NULL will
26855  reset the client back to configuration parameters passed to driver initialization.
26856  A zero in any of the structure elements will reset that specific configuration back
26857  to the driver default.
26858  Precondition:
26859  The DRV_SPI_Open function must have been called before calling
26860  this function.
26861  Parameters:
26862  handle - handle of the client returned by DRV_SPI_Open.
26863  cfgData - Client-specific configuration data.
26864  Returns:
26865  - If successful - the routing will return greater than or equal to zero
26866  - If an error occurs - the return value is negative
26867 */
26868 
26869 int32_t
26871  DRV_HANDLE handle ,
26872  const DRV_SPI_CLIENT_DATA * cfgData ) ;
26873 // *****************************************************************************
26874 /* Function:
26875  void DRV_SPI_Close ( DRV_HANDLE handle )
26876  Summary:
26877  Closes an opened instance of the SPI driver.
26878  <p><b>Implementation:</b> Static/Dynamic</p>
26879  Description:
26880  This function closes an opened instance of the SPI driver, invalidating the
26881  handle.
26882  Precondition:
26883  The DRV_SPI_Initialize routine must have been called for the specified
26884  SPI driver instance.
26885  DRV_SPI_Open must have been called to obtain a valid opened device handle.
26886  Parameters:
26887  handle - A valid open-instance handle, returned from the driver's
26888  open routine
26889  Returns:
26890  None.
26891  Example:
26892  <code>
26893  DRV_HANDLE handle; // Returned from DRV_SPI_Open
26894  DRV_SPI_Close ( handle );
26895  </code>
26896  Remarks:
26897  After calling this routine, the handle passed in "handle" must not be used
26898  with any of the remaining driver routines. A new handle must be obtained by
26899  calling DRV_SPI_Open before the caller may use the driver again. This
26900  function is thread safe in a RTOS application.
26901  Note:
26902  Usually there is no need for the driver client to verify that the Close
26903  operation has completed.
26904 */
26905 
26906 void
26907  DRV_SPI_Close (
26908  DRV_HANDLE handle ) ;
26909 // *****************************************************************************
26910 // *****************************************************************************
26911 // Section: Interface Routines - Client level Read & Write APIs
26912 // *****************************************************************************
26913 // *****************************************************************************
26914 /* These are non-blocking APIs. It doesn't wait until the operation gets
26915  finished. The actual operation will happen it the task routine. The status of
26916  this operation can be monitored using DRV_SPI_BufferStatus function. In
26917  polling mode, User must ensure that the code gets time to execute the task
26918  routine. */
26919 //*******************************************************************************
26920 /* Function:
26921  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead ( DRV_HANDLE handle, void *rxBuffer,
26922  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
26923  void * context )
26924  Summary:
26925  Registers a buffer for a read operation. Actual transfer will happen in
26926  the Task function.
26927  <p><b>Implementation:</b> Static/Dynamic</p>
26928  Description:
26929  Registers a buffer for a read operation. Actual transfer will happen in
26930  the Task function. The status of this operation can be monitored using
26931  DRV_SPI_BufferStatus function. A optional callback can also be
26932  provided that will be called when the operation is complete.
26933  Precondition:
26934  The DRV_SPI_Initialize routine must have been called for the specified
26935  SPI driver instance.
26936  DRV_SPI_Open must have been called to obtain a valid opened device
26937  handle.
26938  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
26939  in the DRV_SPI_Open call.
26940  Parameters:
26941  handle - A valid open-instance handle, returned from the driver's
26942  open routine
26943  rxBuffer - The buffer to which the data should be written to.
26944  size - Number of bytes to be read from the SPI bus.
26945  completeCB - Pointer to a function to be called when this queued operation is complete.
26946  context - unused by the driver but this is passed to the callback when it is called.
26947  Returns:
26948  If the buffer add request is successful, a valid buffer handle is returned.
26949  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
26950  Example:
26951  <code>
26952  DRV_HANDLE handle; // Returned from DRV_SPI_Open
26953  char myBuffer[MY_BUFFER_SIZE], state = 0;
26954  DRV_SPI_BUFFER_HANDLE bufferHandle;
26955  switch ( state )
26956  {
26957  case 0:
26958  bufferHandle = DRV_SPI_BufferAddRead( handle, myBuffer, 10, NULL, NULL );
26959  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
26960  {
26961  state++;
26962  }
26963  break;
26964  case 1:
26965  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
26966  {
26967  state++;
26968  // All transmitter data has been sent successfully.
26969  }
26970  break;
26971  }
26972  </code>
26973  Remarks:
26974  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddRead2"
26975  instead of it.
26976  */
26977 
26980  DRV_HANDLE handle ,
26981  void * rxBuffer ,
26982  size_t size ,
26983  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
26984  void * context ) ;
26985 //*******************************************************************************
26986 /* Function:
26987  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite ( DRV_HANDLE handle, void *txBuffer,
26988  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
26989  void * context )
26990  Summary:
26991  Registers a buffer for a write operation. Actual transfer will happen
26992  in the Task function.
26993  <p><b>Implementation:</b> Static/Dynamic</p>
26994  Description:
26995  Registers a buffer for a write operation. Actual transfer will happen
26996  in the Task function. The status of this operation can be monitored
26997  using DRV_SPI_BufferStatus function. A optional callback can also be
26998  provided that will be called when the operation is complete.
26999  Precondition:
27000  The DRV_SPI_Initialize routine must have been called for the specified
27001  SPI driver instance.
27002  DRV_SPI_Open must have been called to obtain a valid opened device
27003  handle.
27004  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27005  in the DRV_SPI_Open call.
27006  Parameters:
27007  handle - A valid open-instance handle, returned from the driver's
27008  open routine
27009  txBuffer - The buffer which hold the data.
27010  size - Number of bytes to be written to the SPI bus.
27011  completeCB - Pointer to a function to be called when this queued operation is complete
27012  context - unused by the driver but this is passed to the callback when it is called
27013  Returns:
27014  If the buffer add request is successful, a valid buffer handle is returned.
27015  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27016  Example:
27017  <code>
27018  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27019  char myBuffer[MY_BUFFER_SIZE], state = 0;
27020  DRV_SPI_BUFFER_HANDLE bufferHandle;
27021  switch ( state )
27022  {
27023  case 0:
27024  bufferHandle = DRV_SPI_BufferAddWrite( handle, myBuffer, 10, NULL, NULL );
27025  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27026  {
27027  state++;
27028  }
27029  break;
27030  case 1:
27031  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27032  {
27033  state++;
27034  // All transmitter data has been sent successfully.
27035  }
27036  break;
27037  }
27038  </code>
27039  Remarks:
27040  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWrite2"
27041  instead of it.
27042 */
27043 
27046  DRV_HANDLE handle ,
27047  void * txBuffer ,
27048  size_t size ,
27049  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27050  void * context ) ;
27051 //*******************************************************************************
27052 /* Function:
27053  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead( DRV_HANDLE handle,
27054  void *txBuffer, void *rxBuffer, size_t size, )
27055  Summary:
27056  Registers a buffer for a read and write operation. Actual transfer will
27057  happen in the Task function.
27058  <p><b>Implementation:</b> Static/Dynamic</p>
27059  Description:
27060  Registers a buffer for a read and write operation. Actual transfer will
27061  happen in the Task function. The status of this operation can be
27062  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27063  provided that will be called when the operation is complete.
27064  Precondition:
27065  The DRV_SPI_Initialize routine must have been called for the specified
27066  SPI driver instance.
27067  DRV_SPI_Open must have been called to obtain a valid opened device
27068  handle.
27069  Parameters:
27070  handle - A valid open-instance handle, returned from the driver's
27071  open routine
27072  txBuffer - The buffer which hold the data.
27073  txSize - Number of bytes to be written to the SPI bus.
27074  rxBuffer - The buffer to which the data should be written to.
27075  rxSize - Number of bytes to be read from the SPI bus
27076  completeCB - Pointer to a function to be called when this queued operation is complete
27077  context - unused by the driver but this is passed to the callback when it is called
27078  Returns:
27079  If the buffer add request is successful, a valid buffer handle is returned.
27080  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27081  Example:
27082  <code>
27083  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27084  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27085  DRV_SPI_BUFFER_HANDLE bufferHandle;
27086  switch ( state )
27087  {
27088  case 0:
27089  bufferHandle = DRV_SPI_BufferAddWriteRead( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL );
27090  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27091  {
27092  state++;
27093  }
27094  break;
27095  case 1:
27096  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27097  {
27098  state++;
27099  // All transmitter data has been sent successfully.
27100  }
27101  break;
27102  }
27103  </code>
27104  Remarks:
27105  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWriteRead2"
27106  instead of it.
27107 */
27108 
27111  DRV_HANDLE handle ,
27112  void * txBuffer ,
27113  size_t txSize ,
27114  void * rxBuffer ,
27115  size_t rxSize ,
27116  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27117  void * context ) ;
27118 //*******************************************************************************
27119 /* Function:
27120  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2 ( DRV_HANDLE handle, void *rxBuffer,
27121  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27122  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27123  Summary:
27124  Registers a buffer for a read operation. Actual transfer will happen in
27125  the Task function.
27126  <p><b>Implementation:</b> Static/Dynamic</p>
27127  Description:
27128  Registers a buffer for a read operation. Actual transfer will happen in
27129  the Task function. The status of this operation can be monitored using
27130  DRV_SPI_BufferStatus function. A optional callback can also be
27131  provided that will be called when the operation is complete.
27132  Precondition:
27133  The DRV_SPI_Initialize routine must have been called for the specified
27134  SPI driver instance.
27135  DRV_SPI_Open must have been called to obtain a valid opened device
27136  handle.
27137  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
27138  in the DRV_SPI_Open call.
27139  Parameters:
27140  handle - A valid open-instance handle, returned from the driver's
27141  open routine
27142  rxBuffer - The buffer to which the data should be written to.
27143  size - Number of bytes to be read from the SPI bus.
27144  completeCB - Pointer to a function to be called when this queued operation is complete
27145  context - unused by the driver but this is passed to the callback when it is called
27146  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27147  Returns:
27148  If the buffer add request is successful, a valid buffer handle is returned.
27149  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27150  Example:
27151  <code>
27152  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27153  char myBuffer[MY_BUFFER_SIZE], state = 0;
27154  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27155  switch ( state )
27156  {
27157  case 0:
27158  bufferHandle = DRV_SPI_BufferAddRead2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27159  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27160  {
27161  state++;
27162  }
27163  break;
27164  case 1:
27165  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27166  {
27167  state++;
27168  // All transmitter data has been sent successfully.
27169  }
27170  break;
27171  }
27172  </code>
27173  Remarks:
27174  None.
27175  */
27176 
27179  DRV_HANDLE handle ,
27180  void * rxBuffer ,
27181  size_t size ,
27182  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27183  void * context ,
27184  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27185 //*******************************************************************************
27186 /* Function:
27187  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2 ( DRV_HANDLE handle, void *txBuffer,
27188  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27189  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27190  Summary:
27191  Registers a buffer for a write operation. Actual transfer will happen
27192  in the Task function.
27193  <p><b>Implementation:</b> Static/Dynamic</p>
27194  Description:
27195  Registers a buffer for a write operation. Actual transfer will happen
27196  in the Task function. The status of this operation can be monitored
27197  using DRV_SPI_BufferStatus function. A optional callback can also be
27198  provided that will be called when the operation is complete.
27199  Precondition:
27200  The DRV_SPI_Initialize routine must have been called for the specified
27201  SPI driver instance.
27202  DRV_SPI_Open must have been called to obtain a valid opened device
27203  handle.
27204  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27205  in the DRV_SPI_Open call.
27206  Parameters:
27207  handle - A valid open-instance handle, returned from the driver's
27208  open routine
27209  txBuffer - The buffer which hold the data.
27210  size - Number of bytes to be written to the SPI bus.
27211  completeCB - Pointer to a function to be called when this queued operation is complete
27212  context - unused by the driver but this is passed to the callback when it is called
27213  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27214  Returns:
27215  If the buffer add request is successful, a valid buffer handle is returned.
27216  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27217  Example:
27218  <code>
27219  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27220  char myBuffer[MY_BUFFER_SIZE], state = 0;
27221  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27222  switch ( state )
27223  {
27224  case 0:
27225  bufferHandle = DRV_SPI_BufferAddWrite2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27226  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27227  {
27228  state++;
27229  }
27230  break;
27231  case 1:
27232  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27233  {
27234  state++;
27235  // All transmitter data has been sent successfully.
27236  }
27237  break;
27238  }
27239  </code>
27240  Remarks:
27241  None.
27242 */
27243 
27246  DRV_HANDLE handle ,
27247  void * txBuffer ,
27248  size_t size ,
27249  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27250  void * context ,
27251  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27252 //*******************************************************************************
27253 /* Function:
27254  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2( DRV_HANDLE handle,
27255  void *txBuffer, void *rxBuffer, size_t size,
27256  DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27257  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27258  Summary:
27259  Registers a buffer for a read and write operation. Actual transfer will
27260  happen in the Task function.
27261  <p><b>Implementation:</b> Static/Dynamic</p>
27262  Description:
27263  Registers a buffer for a read and write operation. Actual transfer will
27264  happen in the Task function. The status of this operation can be
27265  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27266  provided that will be called when the operation is complete.
27267  Precondition:
27268  The DRV_SPI_Initialize routine must have been called for the specified
27269  SPI driver instance.
27270  DRV_SPI_Open must have been called to obtain a valid opened device
27271  handle.
27272  Parameters:
27273  handle - A valid open-instance handle, returned from the driver's
27274  open routine
27275  txBuffer - The buffer which hold the data.
27276  txSize - Number of bytes to be written to the SPI bus.
27277  rxBuffer - The buffer to which the data should be written to.
27278  rxSize - Number of bytes to be read from the SPI bus
27279  completeCB - Pointer to a function to be called when this queued operation is complete
27280  context - unused by the driver but this is passed to the callback when it is called
27281  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27282  Returns:
27283  If the buffer add request is successful, a valid buffer handle is returned.
27284  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27285  Example:
27286  <code>
27287  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27288  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27289  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27290  switch ( state )
27291  {
27292  case 0:
27293  bufferHandle = DRV_SPI_BufferAddWriteRead2( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL, &bufferHandle2 );
27294  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27295  {
27296  state++;
27297  }
27298  break;
27299  case 1:
27300  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27301  {
27302  state++;
27303  // All transmitter data has been sent successfully.
27304  }
27305  break;
27306  }
27307  </code>
27308  Remarks:
27309  None.
27310 */
27311 
27314  DRV_HANDLE handle ,
27315  void * txBuffer ,
27316  size_t txSize ,
27317  void * rxBuffer ,
27318  size_t rxSize ,
27319  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27320  void * context ,
27321  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27322 // *****************************************************************************
27323 /* Function:
27324  DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus ( DRV_SPI_BUFFER_HANDLE bufferHandle )
27325  Summary:
27326  Returns the transmitter and receiver transfer status.
27327  <p><b>Implementation:</b> Static/Dynamic</p>
27328  Description:
27329  This returns the transmitter and receiver transfer status.
27330  Precondition:
27331  The DRV_SPI_Initialize routine must have been called for the specified
27332  SPI driver instance.
27333  DRV_SPI_Open must have been called to obtain a valid opened device handle.
27334  DRV_SPI_BufferAdd<Transfer> must have been called to obtain
27335  the buffer handle associated with that transfer.
27336  Parameters:
27337  bufferHandle - A valid buffer handle, returned from the driver's
27338  data transfer routine
27339  Returns:
27340  A DRV_SPI_BUFFER_STATUS value describing the current status of the
27341  transfer.
27342  Example:
27343  <code>
27344  // Buffer handle returned from the data transfer function
27345  DRV_SPI_BUFFER_HANDLE bufferHandle;
27346  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27347  {
27348  // All transmitter data has been sent.
27349  }
27350  </code>
27351  Remarks:
27352  The returned status may contain a value with more than one of the bits
27353  specified in the DRV_SPI_BUFFER_STATUS enumeration set. The caller
27354  should perform an AND with the bit of interest and verify if the
27355  result is non-zero (as shown in the example) to verify the desired status
27356  bit.
27357 */
27358 
27361  DRV_SPI_BUFFER_HANDLE bufferHandle ) ;
27362 // *****************************************************************************
27363 /* Function:
27364  bool DRV_SPIn_ReceiverBufferIsFull(void)
27365  Summary:
27366  Returns the receive buffer status. 'n' represents the instance of the
27367  SPI driver used.
27368  <p><b>Implementation:</b> Static</p>
27369  Description:
27370  This function returns the receive buffer status (full/empty).
27371  Precondition:
27372  None.
27373  Parameters:
27374  None.
27375  Returns:
27376  Receive Buffer Status
27377  - 1 - Full
27378  - 0 - Empty
27379  Example:
27380  <code>
27381  bool rxBufStat;
27382  // Using instance 1 of SPI driver, that is n = 1
27383  rxBufStat = DRV_SPI1_ReceiverBufferIsFull();
27384  if (rxBufStat)
27385  {
27386  ...
27387  }
27388  </code>
27389  Remarks:
27390  None.
27391 */
27392 
27393 bool
27395 // *****************************************************************************
27396 /* Function:
27397  bool DRV_SPIn_TransmitterBufferIsFull(void)
27398  Summary:
27399  Returns the transmit buffer status. 'n' represents the instance of the
27400  SPI driver used.
27401  <p><b>Implementation:</b> Static</p>
27402  Description:
27403  This function returns the transmit buffer status (full/empty).
27404  Precondition:
27405  None.
27406  Parameters:
27407  None.
27408  Returns:
27409  Transmit Buffer Status
27410  - 1 - Full
27411  - 0 - Empty
27412  Example:
27413  <code>
27414  bool txBufStat;
27415  // Using instance 1 of SPI driver, that is n = 1
27416  txBufStat = DRV_SPI1_TransmitterBufferIsFull();
27417  if (txBufStat)
27418  {
27419  ...
27420  }
27421  </code>
27422  Remarks:
27423  None.
27424 */
27425 
27426 bool
27428 //DOM-IGNORE-BEGIN
27429 //DOM-IGNORE-END
27430  // #ifndef _DRV_SPI_H
27431 /*******************************************************************************
27432  End of File
27433 */
27434 
27435 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h*/
27436 /* CLOSE_FILE Include File */
27437 
27438 #include "driver/usb/usbhs/drv_usbhs.h"
27439 #include "usb/usb_device.h"
27440 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h */
27441 /**************************************************************************************/
27442 /* LDRA_INSPECTED 110 S
27443 */
27459 /**************************************************************************************/
27460 #ifndef APP_H /* Guard against multiple inclusion.*/
27461 #define APP_H
27462 /**************************************************************************************/
27463 /* ************************************************************************************/
27464 /* Section: Included Files */
27465 /**************************************************************************************/
27466 /**************************************************************************************/
27467 #include <stdint.h>
27468 /**************************************************************************************/
27469 /**************************************************************************************/
27470 /* Section: Data Types */
27471 /**************************************************************************************/
27472 /**************************************************************************************/
27473 /**************************************************************************************/
27474 /* APP_DATA
27475  Summary:
27476  Holds APP_DATA used for the APP tasks.
27477  Description:
27478  Holds APP_DATA used for the APP tasks. The variables
27479  used are stored here.
27480  Remarks:
27481  None
27482  */
27483 
27484 typedef
27485  struct
27486  {
27487  uint8_t RevNumber ;
27488  } APP_DATA ;
27489 
27490 extern APP_DATA
27491  APP ;
27492 /**************************************************************************************/
27493 /**************************************************************************************/
27494 /* Section: Application Initialization and State Machine Functions */
27495 /**************************************************************************************/
27496 /**************************************************************************************/
27497 /*!*************************************************************************************
27498  Function:
27499  void APP_Initialize(void)
27500  Summary:
27501  Autonomous tool application initialization routine.
27502  Description:
27503  This function initializes the application. It places the
27504  application in its initial state and prepares it to run so that its
27505  APP_Tasks function can be called.
27506  Precondition:
27507  All other system initialization routines should be called before calling
27508  this routine (in "SYS_Initialize").
27509  Parameters:
27510  None.
27511  Returns:
27512  None.
27513  Example:
27514  APP_Initialize()
27515  Remarks:
27516  This routine must be called from the main function.
27517 */
27518 
27519 void
27520  APP_Initialize ( void ) ;
27521 /*!*************************************************************************************
27522  Function:
27523  void APP_Tasks(void)
27524  Summary:
27525  Application tasks function
27526  Description:
27527  This function is the main application's tasks function. It contains the various
27528  tasks that are maintained during the operation of the shooting panel.
27529  Precondition:
27530  The system ("SYS_Initialize") and application ("APP_Initialize") initialization
27531  should be called before calling this.
27532  Parameters:
27533  None.
27534  Returns:
27535  None.
27536  Example:
27537  APP_Tasks()
27538  Remarks:
27539  This routine must be called from the main() routine.
27540  */
27541 
27542 void
27543  APP_Tasks ( void ) ;
27544  /* APP_H */
27545 /***************************************************************************************
27546  End of File
27547  */
27548 
27549 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h*/
27550 /* CLOSE_FILE Include File */
27551 
27552 // DOM-IGNORE-BEGIN
27553 // DOM-IGNORE-END
27554 // *****************************************************************************
27555 // *****************************************************************************
27556 // Section: Type Definitions
27557 // *****************************************************************************
27558 // *****************************************************************************
27559 // *****************************************************************************
27560 /* System Objects
27561  Summary:
27562  Structure holding the system's object handles
27563  Description:
27564  This structure contains the object handles for all objects in the
27565  MPLAB Harmony project's system configuration.
27566  Remarks:
27567  These handles are returned from the "Initialize" functions for each module
27568  and must be passed into the "Tasks" function for each module.
27569 */
27570 
27571 typedef
27572  struct
27573  {
27574  SYS_MODULE_OBJ sysTmr ;
27575  SYS_MODULE_OBJ drvTmr0 ;
27576  SYS_MODULE_OBJ drvTmr1 ;
27577  SYS_MODULE_OBJ drvTmr2 ;
27578  SYS_MODULE_OBJ drvTmr3 ;
27579  SYS_MODULE_OBJ drvTmr4 ;
27580  SYS_MODULE_OBJ drvUsart0 ;
27581  SYS_MODULE_OBJ drvPMP0 ;
27582  /*** SPI Object for Index 0 ***/
27583  SYS_MODULE_OBJ spiObjectIdx0 ;
27584  /*** SPI Object for Index 1 ***/
27585  SYS_MODULE_OBJ spiObjectIdx1 ;
27586  /*** SPI Object for Index 2 ***/
27587  SYS_MODULE_OBJ spiObjectIdx2 ;
27588  SYS_MODULE_OBJ drvUSBObject ;
27589  SYS_MODULE_OBJ usbDevObject0 ;
27590  } SYSTEM_OBJECTS ;
27591 // *****************************************************************************
27592 // *****************************************************************************
27593 // Section: extern declarations
27594 // *****************************************************************************
27595 // *****************************************************************************
27596 
27597 extern SYSTEM_OBJECTS
27598  sysObj ;
27599 //DOM-IGNORE-BEGIN
27600 //DOM-IGNORE-END
27601  /* _SYS_DEFINITIONS_H */
27602 /*******************************************************************************
27603  End of File
27604 */
27605 
27606 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h*/
27607 /* CLOSE_FILE Include File */
27608 
27609 /**************************************************************************************/
27610 /**************************************************************************************/
27611 /* Section: Data Types */
27612 /**************************************************************************************/
27613 /**************************************************************************************/
27614 /**************************************************************************************/
27615 /* USB states
27616  Summary:
27617  USB states enumeration
27618  Description:
27619  This enumeration defines the valid USB states. These states
27620  determine the behavior of the USB state machine at various times.
27621 */
27622 
27623 typedef
27624  enum
27625  {
27634  } USB_STATES ;
27635 /**************************************************************************************/
27636 /* USB_DATA
27637  Summary:
27638  Holds USB_DATA used for the USB tasks.
27639  Description:
27640  Holds USB_DATA used for the USB tasks. The state machine and variables
27641  used to control USB functions are stored here.
27642  Remarks:
27643  None
27644  */
27645 
27646 typedef
27647  struct
27648  {
27649  USB_STATES state ;
27650  USB_DEVICE_HANDLE usbDevHandle ;
27651  bool deviceIsConfigured ;
27652  uint8_t configValue ;
27653  USB_SPEED speed ;
27654  bool epDataWritePending ;
27655  bool epDataReadPending ;
27656  USB_DEVICE_TRANSFER_HANDLE writeTranferHandle ;/* Write transfer handle.*/
27657  USB_DEVICE_TRANSFER_HANDLE readTranferHandle ;/* Read transfer handle.*/
27658  USB_ENDPOINT_ADDRESS endpointTx ;
27659  USB_ENDPOINT_ADDRESS endpointRx ;
27660  uint8_t altSetting ;
27661  uint8_t byte_count ;
27662  bool attached ;
27663  bool tick ;
27664  } USB_DATA ;
27665 
27666 extern USB_DATA
27667  USB ;
27668 /**************************************************************************************/
27669 /**************************************************************************************/
27670 /* Section: Local Functions */
27671 /**************************************************************************************/
27672 /**************************************************************************************/
27673 /*!*************************************************************************************
27674  Function:
27675  static void usb_watchdog(void)
27676  Summary:
27677  This function initializes the wire-line communication power supply parameters.
27678  Description:
27679  This function initializes the wire-line communication power supply parameters.
27680  Initial limits, flags and constants are set here.
27681 
27682  Precondition:
27683  None.
27684  Parameters:
27685  None.
27686  Returns
27687  None.
27688 
27689  Remarks
27690  None.
27691 
27692  Example:
27693  usb_watchdog()
27694  */
27695 
27696 static void
27697  usb_watchdog ( void ) ;
27698 /**************************************************************************************/
27699 /**************************************************************************************/
27700 /* State Machine Functions */
27701 /**************************************************************************************/
27702 /**************************************************************************************/
27703 /*!*************************************************************************************
27704  Function:
27705  void USB_Tasks(void)
27706  Summary:
27707  USB_Tasks function
27708  Description:
27709  This routine is the USB Tasks function. It defines the USB's state machine and
27710  core logic. This machine controls the USB operation and sets flags indicating
27711  new values are available.
27712  Precondition:
27713  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
27714  should be called before calling this.
27715  Parameters:
27716  None.
27717  Returns:
27718  None.
27719  Example:
27720  USB_Tasks()
27721 
27722  Remarks:
27723  This routine must be called from the APP_Tasks() routine.
27724  */
27725 
27726 void
27727  USB_Tasks ( void ) ;
27728  /* USB_H */
27729 /***************************************************************************************
27730  End of File
27731  */
27732 
27733 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\USB.h*/
27734 /* CLOSE_FILE Include File */
27735 
27736 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\commands.h */
27737 /**************************************************************************************/
27751 /**************************************************************************************/
27752 #ifndef COMMANDS_H /* Guard against multiple inclusion.*/
27753 #define COMMANDS_H
27754 /**************************************************************************************/
27755 /**************************************************************************************/
27756 /* Section: Included Files */
27757 /**************************************************************************************/
27758 /**************************************************************************************/
27759 #include <stdbool.h>
27760 #include <stdint.h>
27761 /**************************************************************************************/
27762 /**************************************************************************************/
27763 /* Section: Global Variables */
27764 /**************************************************************************************/
27765 /**************************************************************************************/
27766 
27767 extern bool
27768  DepthStatus ;
27769 /**************************************************************************************/
27770 /**************************************************************************************/
27771 /* Section: Type Definition */
27772 /**************************************************************************************/
27773 /**************************************************************************************/
27774 
27775 typedef
27776 unsigned char
27778 /**************************************************************************************/
27779 /**************************************************************************************/
27780 /* Section: Data Types */
27781 /**************************************************************************************/
27782 /**************************************************************************************/
27783 /**************************************************************************************/
27784 
27785 typedef
27786  enum
27787  {
27792  } COMMAND_STATES ;
27793 
27794 typedef
27795  struct /* This structure collects the variables and states required for these*/
27796  {
27797  /* functions to operate.*/
27798  COMMAND_STATES state ;/* The COMMAND_TASKS machine current state.*/
27799  uint16_t crc ;
27800  uint8_t cmd_size ;
27801  uint8_t command [ 7 ] ;
27802  bool process_complete_flag ;
27803  bool b_command_complete_flag ;
27804  bool sw_status_bit_check ;
27805  } COMMAND_DATA ;
27806 
27807 extern COMMAND_DATA
27808  CMD ;
27809 /**************************************************************************************/
27810 /**************************************************************************************/
27811 /* Section: Interface Functions */
27812 /**************************************************************************************/
27813 /**************************************************************************************/
27814 /*!*************************************************************************************
27815  Function:
27816  void COMMAND_Tasks( void )
27817  Summary:
27818  This function executes the commands from the host.
27819  Description:
27820  This function executes the commands from the host. It does this by first ensuring
27821  the CRC of the received command is correct. If the CRC check matches, it goes on
27822  to execute the command. The commands are divided up into three types; Protocol A,
27823  Protocol B and System. Protocol A commands control the function of the Panel
27824  Interface Board. Protocol B commands are for a PerfSwitch or other down hole tool.
27825  System commands control the panel operation while it is being used for shooting.
27826  An example would be showing the depth status.
27827 
27828  Precondition:
27829  None.
27830  Parameters:
27831  None.
27832  Returns
27833  None.
27834 
27835  Remarks:
27836  None.
27837 
27838  Example:
27839  void COMMAND_Tasks()
27840  */
27841 
27842 void
27843  COMMAND_Tasks ( void ) ;
27844 /**************************************************************************************/
27845 /**************************************************************************************/
27846 /* Section: Local Functions */
27847 /**************************************************************************************/
27848 /**************************************************************************************/
27849 /*!*************************************************************************************
27850  Function:
27851  bool Valid_Command( uchar8_t msg )
27852  Summary:
27853  This function compares the received command(first byte)and compares it to a list
27854  of correct commands.
27855  Description:
27856  This function compares the received command(first byte)and compares it to a list
27857  of correct commands. If there is a match, the rest of the transmission is
27858  received for processing. Used in the ValidateComm function in commmodule.c
27859 
27860  Precondition:
27861  None.
27862  Parameters:
27863  uchar8_t msg - The one byte command to compare.
27864  Returns
27865  bool ans - true if command is valid.
27866 
27867  Remarks
27868  None.
27869 
27870  Example:
27871  Valid_Command( command )
27872  */
27873 
27874 bool
27875  Valid_Command (
27876  uchar8_t msg ) ;
27877 /*!*************************************************************************************
27878  Function:
27879  bool GetDepthStatus ( void )
27880  Summary:
27881  This function compares the received command(first byte)and compares it to a list
27882  of correct commands.
27883  Description:
27884  This function compares the received command(first byte)and compares it to a list
27885  of correct commands. If there is a match, the rest of the transmission is
27886  received for processing. Used in the ValidateComm function in commmodule.c
27887 
27888  Precondition:
27889  None.
27890  Parameters:
27891  unsigned char msg - The one byte command to compare.
27892  Returns
27893  unsigned short ans.
27894 
27895  Remarks
27896  None.
27897 
27898  Example:
27899  GetDepthStatus ( )
27900  */
27901 
27902 bool
27903  GetDepthStatus ( void ) ;
27904 /*!*************************************************************************************
27905  Function:
27906  static void Execute_Auto_Protocol_A (void)
27907  Summary:
27908  This function executes the Auto Protocol A commands.
27909  Description:
27910  This function executes the Auto Protocol A commands. These are commands that
27911  control the panel. The commands are listed as case statements. Once the action is
27912  completed, a response is generated and sent back to the host.
27913 
27914  Precondition:
27915  None.
27916  Parameters:
27917  None.
27918  Returns
27919  None.
27920 
27921  Remarks
27922  None.
27923 
27924  Example:
27925  Execute_Auto_Protocol_A ()
27926  */
27927 
27928 static void
27929  Execute_Auto_Protocol_A ( void ) ;
27930 /*!*************************************************************************************
27931  Function:
27932  static void Execute_Protocol_A (void)
27933  Summary:
27934  This function executes the Protocol A commands.
27935  Description:
27936  This function executes the Protocol A commands. These are commands that control
27937  the panel. The commands are listed as case statements. Once the action is
27938  completed, a response is generated and sent back to the host.
27939 
27940  Precondition:
27941  None.
27942  Parameters:
27943  None.
27944  Returns
27945  None.
27946 
27947  Remarks
27948  None.
27949 
27950  Example:
27951  ExecuteProtocolA ()
27952  */
27953 
27954 static void
27955  Execute_Protocol_A ( void ) ;
27956 /*!*************************************************************************************
27957  Function:
27958  static void Execute_Protocol_B (void)
27959  Summary:
27960  This function executes the Protocol B commands.
27961  Description:
27962  This function executes the Protocol B commands. These are commands that are for
27963  a PerfSwitch or other tool. The commands are listed as case statements. Once
27964  the action is completed, a response is generated and sent back to the host.
27965 
27966  Precondition:
27967  None.
27968  Parameters:
27969  None.
27970  Returns
27971  None.
27972 
27973  Remarks
27974  None.
27975 
27976  Example:
27977  ExecuteProtocolB ()
27978  */
27979 
27980 static void
27981  Execute_Protocol_B ( void ) ;
27982 /*!*************************************************************************************
27983  Function:
27984  static void Execute_System(void)
27985  Summary:
27986  This function executes the system commands.
27987  Description:
27988  This function executes the system commands. Once the action is completed, a
27989  response is generated and sent back to the host.
27990 
27991  Precondition:
27992  None.
27993  Parameters:
27994  None.
27995  Returns
27996  None.
27997 
27998  Remarks
27999  None.
28000 
28001  Example:
28002  ExecuteSystem()
28003  */
28004 
28005 static void
28006  Execute_System ( void ) ;
28007  /* COMMANDS_H */
28008 /***************************************************************************************
28009  End of File
28010  */
28011 
28012 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\commands.h*/
28013 /* CLOSE_FILE Include File */
28014 
28015 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\commmodule.h */
28016 /**************************************************************************************/
28032 /**************************************************************************************/
28033 #ifndef COMMMODULE_H /* Guard against multiple inclusion.*/
28034 #define COMMMODULE_H
28035 /**************************************************************************************/
28036 /**************************************************************************************/
28037 /* Section: Included Files */
28038 /**************************************************************************************/
28039 /**************************************************************************************/
28040 #include "../system_definitions.h"
28041 /**************************************************************************************/
28042 /**************************************************************************************/
28043 /* Section: Data Types */
28044 /**************************************************************************************/
28045 /**************************************************************************************/
28046 /**************************************************************************************/
28047 /* COMM states
28048  Summary:
28049  COMM states enumeration
28050  Description:
28051  This enumeration defines the valid COMM states. These states
28052  determine the behavior of the COMM state machine at various times.
28053 */
28054 
28055 typedef
28056  enum
28057  {
28062  } COMM_STATES ;
28063 /**************************************************************************************/
28064 /* COMM Data
28065  Summary:
28066  Holds COMM data used for the COMM tasks.
28067  Description:
28068  Holds COMM data used for the COMM tasks. The state machine and variables used
28069  to control COMM message are stored here.
28070  Remarks:
28071  None
28072  */
28073 
28074 typedef
28075  struct /* This structure collects the variables and states required for these*/
28076  {
28077  /* functions to operate.*/
28078  COMM_STATES state ;
28079  DRV_HANDLE handleUSART0 ;
28080  uint8_t tx_count ;
28081  uint8_t rx_count ;
28082  bool processing ;
28083  } COMM_DATA ;
28084 
28085 extern COMM_DATA
28086  COMM ;
28087 /**************************************************************************************/
28088 /**************************************************************************************/
28089 /* Section: Local Functions */
28090 /**************************************************************************************/
28091 /**************************************************************************************/
28092 /*!*************************************************************************************
28093  Function:
28094  static void ValidateComm(void)
28095  Summary:
28096  This function reads the battery voltage, temperature and remaining capacity
28097  based on the command given to the function
28098  Description:
28099  Description: This task handles reading messages from Receive Queue (RxQ Fifo) and
28100  processes them. It looks for a valid command & upon finding it puts the remainder
28101  into the Command buffer for processing.
28102 
28103 
28104 
28105  Precondition:
28106  None.
28107  Parameters:
28108  None.
28109  Returns
28110  None.
28111 
28112  Remarks
28113  None.
28114 
28115  Example:
28116  void ValidateComm()
28117  */
28118 
28119 static void
28120  ValidateComm ( void ) ;
28121 /**************************************************************************************/
28122 /**************************************************************************************/
28123 /* State Machine Functions */
28124 /**************************************************************************************/
28125 /**************************************************************************************/
28126 /*!*************************************************************************************
28127  Function:
28128  void COMM_Tasks(void)
28129  Summary:
28130  COMM tasks function
28131  Description:
28132  This routine is the COMM tasks function. It defines the COMM's state machine and
28133  core logic. This task controls the communications between a host UART or host USB.
28134  Precondition:
28135  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28136  should be called before calling this.
28137  Parameters:
28138  None.
28139  Returns:
28140  None.
28141  Example:
28142  COMM_Tasks()
28143 
28144  Remarks:
28145  This routine must be called from COMM_Tasks() routine.
28146  */
28147 
28148 void
28149  COMM_Tasks ( void ) ;
28150  /* COMMMODULE_H */
28151 /***************************************************************************************
28152  End of File
28153  */
28154 
28155 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\commmodule.h*/
28156 /* CLOSE_FILE Include File */
28157 
28158 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\fifo.h */
28159 /**************************************************************************************/
28173 /**************************************************************************************/
28174 #ifndef FIFO_H /* Guard against multiple inclusion */
28175 #define FIFO_H
28176 /**************************************************************************************/
28177 /**************************************************************************************/
28178 /* Section: Included Files */
28179 /**************************************************************************************/
28180 /**************************************************************************************/
28181 #include <stdbool.h>
28182 #include <stdint.h>
28183 /**************************************************************************************/
28184 /**************************************************************************************/
28185 /* Section: Defines */
28186 /**************************************************************************************/
28187 /**************************************************************************************/
28188 #define FIFO_RX_SIZE 7
28189 #define FIFO_TX_SIZE 7
28190  /* FifoPut Return values.*/
28191 #define FIFO_ADD_OK 0
28192 #define FIFO_FULL 1
28193  /* FifoGet Return Value.*/
28194 #define FIFO_EMPTY 2U
28195 /**************************************************************************************/
28196 /**************************************************************************************/
28197 /* Section: Data Types */
28198 /**************************************************************************************/
28199 /**************************************************************************************/
28200 
28201 typedef
28202  struct
28203  {
28204  uint8_t length ;
28205  uint8_t * ptr_buffer ;
28207  /* Filled in by the FIFO functions.*/
28208  uint8_t head ;
28209  uint8_t tail ;
28210  uint8_t num_records ;
28211  uint8_t put_error ;
28212  uint8_t get_error ;
28213  bool fEmpty ;
28214  bool fFull ;
28215  } TFifo ;
28216 
28217 extern TFifo
28218  RX_FIFO ; /* This structure is used for both the RxFifo and TxFifo.*/
28219 
28220 extern TFifo
28221  TX_FIFO ;
28222 /**************************************************************************************/
28223 /**************************************************************************************/
28224 /* Section: Local Functions */
28225 /**************************************************************************************/
28226 /**************************************************************************************/
28227 /*!*************************************************************************************
28228  Function:
28229  static void Fifo_Init( TFifo *ptrFifo, unsigned char *ptrBuffer, int Length )
28230  Summary:
28231  This function initializes a given Fifo.
28232  Description:
28233  This function initializes the communication Fifo. It is used to initialize both
28234  the transmit and receive Fifo's.
28235 
28236  Precondition:
28237  None.
28238  Parameters:
28239  None.
28240  Returns
28241  None.
28242 
28243  Remarks:
28244  None.
28245 
28246  Example:
28247  Fifo_Init( &RX_FIFO, FifoRxBuffer, FIFO_RX_SIZE )
28248  */
28249 
28250 static void
28251  Fifo_Init (
28252  TFifo * ptrFifo ,
28253  uint8_t * ptrBuffer ,
28254  uint16_t Length ) ;
28255 /**************************************************************************************/
28256 /**************************************************************************************/
28257 /* Section: Interface Functions */
28258 /**************************************************************************************/
28259 /**************************************************************************************/
28260 /*!*************************************************************************************
28261  Function:
28262  void Init_Fifo(void)
28263  Summary:
28264  This function calls the function Fifo_Init to initialize the RxFifo and TxFifo.
28265  Description:
28266  This function calls the function Fifo_Init to initialize the RxFifo and TxFifo.
28267  This function is called in APP_Initialize in app.c
28268 
28269 
28270  Precondition:
28271  None.
28272  Parameters:
28273  None.
28274  Returns
28275  None.
28276 
28277  Remarks:
28278  None.
28279 
28280  Example:
28281  Init_Fifo()
28282  */
28283 
28284 void
28285  Init_Fifo ( void ) ;
28286 /*!*************************************************************************************
28287  Function:
28288  uint8_t Fifo_Put( TFifo *ptrFifo, uint8_t Data )
28289  Summary:
28290  Function to add an entry (byte)to a Fifo.
28291  Description:
28292  Function to add an entry (byte)to a Fifo. If the Fifo is full then the function
28293  returns FIFO_FULL, otherwise the function adds the entry to the FifoBuffer,
28294  increments FifoHead and returns FIFO_ADD_OK.
28295 
28296  Precondition:
28297  None.
28298  Parameters:
28299  uint8_t Data: The byte of data to be added.
28300  TFifo *ptrFifo: The pointer to the Fifo that is being manipulated.
28301  Returns
28302  integer value. Fifo_Full or FIFO_ADD_OK
28303 
28304  Remarks:
28305  None.
28306 
28307  Example:
28308  Fifo_Put( &TX_FIFO, b_comm_crc )
28309  */
28310 
28311 uint8_t
28312  Fifo_Put (
28313  TFifo * ptrFifo ,
28314  uint8_t Data ) ;
28315 /*!*************************************************************************************
28316  Function:
28317  uint8_t Fifo_Get( TFifo *ptrFifo )
28318  Summary:
28319  Function to retrieve an entry from Fifo.
28320  Description:
28321  Function to retrieve an entry from Fifo. If Fifo is empty then function returns
28322  FIFO_EMPTY. Otherwise, the function returns the oldest entry in FifoBuffer and
28323  increments FifoTail.
28324 
28325  Precondition:
28326  None.
28327  Parameters:
28328  TFifo *ptrFifo
28329  Returns
28330  uint8_t Contents of Fifo buffer.
28331 
28332  Remarks:
28333  None.
28334 
28335  Example:
28336  temp = Fifo_Get( &RX_FIFO )
28337  */
28338 
28339 uint8_t
28340  Fifo_Get (
28341  TFifo * ptrFifo ) ;
28342 /*!*************************************************************************************
28343  Function:
28344  uint8_t Fifo_Length( TFifo *ptrFifo )
28345  Summary:
28346  Function to find the length of the buffer.
28347  Description:
28348  Function to find the length of the buffer.
28349 
28350  Precondition:
28351  None.
28352  Parameters:
28353  TFifo *ptrFifo: The pointer to the Fifo.
28354  Returns
28355  uint8_t. Length of the fifo buffer.
28356 
28357  Remarks:
28358  None.
28359 
28360  Example:
28361  if( Fifo_Length( &RX_FIFO ) == CMD.cmd_size )
28362  */
28363 
28364 uint8_t
28365  Fifo_Length (
28366  TFifo * ptrFifo ) ;
28367  /* FIFO_H */
28368 /***************************************************************************************
28369  End of File
28370  */
28371 
28372 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\fifo.h*/
28373 /* CLOSE_FILE Include File */
28374 
28375 /**************************************************************************************/
28376 /**************************************************************************************/
28377 /* Section: Structure Data and Local Variables */
28378 /**************************************************************************************/
28379 /**************************************************************************************/
28380 #define USB_READ_BUFFER_SIZE 64
28381 /* Fulfill USB DMA transfer criteria */
28382 #define USB_MAKE_BUFFER_DMA_READY __attribute__ ( ( coherent ) ) __attribute__ ( ( aligned ( 16 ) ) )
28383 #define APP_EP_BULK_IN 1U
28384 #define APP_EP_BULK_OUT 1U
28385 /**************************************************************************************/
28386 /* USB Data
28387  Summary:
28388  These structures hold the required states and variables to perform the USB tasks.
28389  Description:
28390  These structures hold the required states and variables to perform the USB tasks.
28391  These are here to link these structures for use by the local functions.
28392 
28393  Remarks:
28394  These are defined in USB.h
28395 */
28396 
28397 USB_DATA
28399 
28400 uint8_t
28401  receivedDataBuffer [ 64 ] __attribute__ ( ( coherent ) ) __attribute__ ( ( aligned ( 16 ) ) ) ;/* Receive data buffer.*/
28402 
28403 uint8_t
28404  transmitDataBuffer [ 64 ] __attribute__ ( ( coherent ) ) __attribute__ ( ( aligned ( 16 ) ) ) ;/* Transmit data buffer.*/
28405 
28406 uint16_t
28407  endpointSize ; /* The endpoint size is 64 for FS and 512 for HS.*/
28408 
28409 uint8_t
28410  usb_tick_count ;
28411 
28412 bool
28413  data_sent ;
28414 /**************************************************************************************/
28415 /**************************************************************************************/
28416 /* Application USB Device Layer Event Handler */
28417 /**************************************************************************************/
28418 /**************************************************************************************/
28419 
28420 void
28422  USB_DEVICE_EVENT event ,
28423  void * eventData ,
28424  uintptr_t context )
28425  {
28426  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 28))); /* 37 */
28427  uint8_t *
28428  configurationValue ;
28429 
28430  USB_SETUP_PACKET
28431  * setupPacket ;
28432  switch (
28433  ( ( int )( /* 29 */
28434  event
28435  ))*
28436  ((bitmapstruct.element1 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 29) : 0)), 1 ) /* 19 */
28437  )
28438  {
28439  case USB_DEVICE_EVENT_RESET :
28440  ((bitmapstruct.element1 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 30) : 0)), 1 ); /* 41 */
28441  {
28442  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 ) ;
28443  USB.deviceIsConfigured = false ;
28444  /* Flag to show device is not configured. The host has not*/
28445  /* enumerated it yet.*/
28446  }
28447  ((int)(bitmapstruct.element1 |= (1 << 31))); /* 16 */
28448  goto l128291 ;
28449  case USB_DEVICE_EVENT_DECONFIGURED :
28450  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 0) : 0)), 1 ); /* 41 */
28451  /* Device is reset or de-configured.*/
28452  {
28453  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 ) ;
28454  USB.deviceIsConfigured = false ;
28455  /* Flag to show device is not configured. The host has not*/
28456  /* enumerated it yet.*/
28457  }
28458  ((int)(bitmapstruct.element2 |= (1 << 1))); /* 16 */
28459  goto l128291 ;
28460  case USB_DEVICE_EVENT_CONFIGURED :
28461  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 2) : 0)), 1 ); /* 41 */
28462  {
28463  configurationValue = ( uint8_t * ) eventData ;/* Check the configuration */
28464  if
28465  (
28466  *configurationValue == 1U
28467  ) /* The device is in configured state. Update the LED indication.*/
28468  {
28469  ((int)(bitmapstruct.element2 |= (1 << 3))); /* 1 */
28470  {
28471  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 ) ;
28472  USB.deviceIsConfigured = true ; /* Reset endpoint data send & receive flag.*/
28473  }
28474  } else ((int)(bitmapstruct.element2 |= (1 << 4))); /* 4 */
28475  }
28476  ((int)(bitmapstruct.element2 |= (1 << 5))); /* 16 */
28477  goto l128291 ;
28478  case USB_DEVICE_EVENT_SUSPENDED :
28479  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 6) : 0)), 1 ); /* 41 */
28480  /* Device is suspended. Update LED indication.*/
28481  {
28482  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 ) ;
28483  }
28484  ((int)(bitmapstruct.element2 |= (1 << 7))); /* 16 */
28485  goto l128291 ;
28486  case USB_DEVICE_EVENT_POWER_DETECTED :
28487  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 8) : 0)), 1 ); /* 41 */
28488  /* VBUS is detected. Attach the device.*/
28489  {
28490  USB_DEVICE_Attach ( USB.usbDevHandle ) ;
28491  USB.attached = true ; /* Flag to show USB is attached to host.*/
28492  }
28493  ((int)(bitmapstruct.element2 |= (1 << 9))); /* 16 */
28494  goto l128291 ;
28495  case USB_DEVICE_EVENT_POWER_REMOVED :
28496  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 10) : 0)), 1 ); /* 41 */
28497  /* VBUS is removed. Detach the device.*/
28498  {
28499  USB_DEVICE_Detach ( USB.usbDevHandle ) ;
28500  USB.attached = false ; /* Flag to show USB is detached from host.*/
28501  }
28502  ((int)(bitmapstruct.element2 |= (1 << 11))); /* 16 */
28503  goto l128291 ;
28504  case USB_DEVICE_EVENT_CONTROL_TRANSFER_SETUP_REQUEST :
28505  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 12) : 0)), 1 ); /* 41 */
28506  /* This means we have received a setup packet.*/
28507  {
28508  /* LDRA_INSPECTED 94 S
28509 */ /*MPLAB Harmony generated function.*/
28510  setupPacket = ( USB_SETUP_PACKET * ) eventData ;
28511  if
28512  (
28513  setupPacket -> bRequest == USB_REQUEST_SET_INTERFACE
28514  ) /* If we have got the SET_INTERFACE request, we just acknowledge*/
28515  {
28516  ((int)(bitmapstruct.element2 |= (1 << 13))); /* 1 */
28517  {
28518  /* for now. This system has only one alternate setting which is already*/
28519  /*active.*/
28520  USB_DEVICE_ControlStatus ( USB.usbDevHandle , USB_DEVICE_CONTROL_STATUS_OK ) ;
28521  }
28522  ((int)(bitmapstruct.element2 |= (1 << 14))); /* 3 */
28523  }
28524  else
28525  {
28526  ((int)(bitmapstruct.element2 |= (1 << 15))); /* 2 */
28527  {
28528  if
28529  (
28530  setupPacket -> bRequest == USB_REQUEST_GET_INTERFACE
28531  ) /* We have only one alternate setting and this setting 0. So*/
28532  {
28533  ((int)(bitmapstruct.element2 |= (1 << 16))); /* 1 */
28534  {/* we send this information to the host. */
28535  USB_DEVICE_ControlSend ( USB.usbDevHandle , & USB.altSetting , 1 ) ;
28536  }
28537  ((int)(bitmapstruct.element2 |= (1 << 17))); /* 3 */
28538  }
28539  else/* We have received a request that we cannot handle. Stall it.*/
28540  {
28541  ((int)(bitmapstruct.element2 |= (1 << 18))); /* 2 */
28542  {
28543  USB_DEVICE_ControlStatus ( USB.usbDevHandle , USB_DEVICE_CONTROL_STATUS_ERROR ) ;
28544  }
28545  }
28546  }
28547  }
28548  }
28549  ((int)(bitmapstruct.element2 |= (1 << 19))); /* 16 */
28550  goto l128291 ;
28551  case USB_DEVICE_EVENT_ENDPOINT_READ_COMPLETE :
28552  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 20) : 0)), 1 ); /* 41 */
28553  /* Endpoint read is complete.*/
28554  {
28555  USB.epDataReadPending = false ; /* Reset this flag.*/
28556  }
28557  ((int)(bitmapstruct.element2 |= (1 << 21))); /* 16 */
28558  goto l128291 ;
28559  case USB_DEVICE_EVENT_ENDPOINT_WRITE_COMPLETE :
28560  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 22) : 0)), 1 ); /* 41 */
28561  /* Endpoint write is complete.*/
28562  {
28563  USB.epDataWritePending = false ; /* Reset this flag.*/
28564  }
28565  ((int)(bitmapstruct.element2 |= (1 << 23))); /* 16 */
28566  goto l128291 ;
28567  case USB_DEVICE_EVENT_RESUMED :
28568  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 24) : 0)), 1 ); /* 41 */
28569  /* These events are not used. */
28570  {
28571  }
28572  ((int)(bitmapstruct.element2 |= (1 << 25))); /* 16 */
28573  goto l128291 ;
28574  case USB_DEVICE_EVENT_ERROR :
28575  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 26) : 0)), 1 ); /* 41 */
28576  /* These events are not used. */
28577  {
28578  }
28579  ((int)(bitmapstruct.element2 |= (1 << 27))); /* 16 */
28580  goto l128291 ;
28581  default :
28582  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 28) : 0)), 1 ); /* 41 */
28583  {
28584  /*Comment.*/
28585  }
28586  ((int)(bitmapstruct.element2 |= (1 << 29))); /* 16 */
28587  goto l128291 ;
28588  }
28589 l128291 :
28590  ; /* 18 */
28591  ((int)(bitmapstruct.element2 |= (1 << 30))); /* 30 */
28592  USB_62zqendz ( 95 ) ; /* 30 */
28593  }
28594 /**************************************************************************************/
28595 /**************************************************************************************/
28596 /* Section: State Machine Functions */
28597 /**************************************************************************************/
28598 /**************************************************************************************/
28599 /***************************************************************************************
28600  Function:
28601  void USB_Tasks ( void )
28602 
28603  Summary:
28604  This routine is the USB_tasks function. It defines the (USB) state machine and
28605  core logic.
28606  Remarks:
28607  Refer to the USB.h interface header for function usage details.
28608  */
28609 
28610 void
28611  USB_Tasks ( void ) /* USB state machine.*/
28612  {
28613  int izzqqzz=((int)(bitmapstruct.element2 |= (1 << 31))); /* 37 */
28614  switch (
28615  ( ( int )( /* 29 */
28616  USB.state
28617  ))*
28618  ((bitmapstruct.element3 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 0) : 0)), 1 ) /* 19 */
28619  ) /* Check the machines current state.*/
28620  {
28621  case USB_STATE_INIT :
28622  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 1) : 0)), 1 ); /* 41 */
28623  /* This machines initial state.*/
28624  {
28625  USB.usbDevHandle = USB_DEVICE_HANDLE_INVALID ; /* Set the handle to invalid.*/
28626  USB.deviceIsConfigured = false ; /* The device has not been configured.*/
28627  USB.endpointRx = ( 1U | USB_EP_DIRECTION_OUT ) ; /* Define the receive endpoint.*/
28628  USB.endpointTx = ( 1U | USB_EP_DIRECTION_IN ) ; /* Define the transmit endpoint.*/
28629  USB.epDataReadPending = false ; /* Initialize to no reads pending.*/
28630  USB.epDataWritePending = false ; /* Initialize to no writes pending.*/
28631  USB.altSetting = 0U ;
28632  USB.byte_count = 0U ;
28633  USB.attached = false ;
28634  USB.tick = false ; /* Initialize timer tick.*/
28635  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 ) ;/* Set high so USB can enumerate.*/
28636  USB.state = USB_STATE_OPEN ; /* Move on to open the USB port.*/
28637  usb_tick_count = 0U ; /* Initialize timer tick count.*/
28638  data_sent = false ;
28639  }
28640  ((int)(bitmapstruct.element3 |= (1 << 2))); /* 16 */
28641  goto l128584 ;
28642  case USB_STATE_OPEN :
28643  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 3) : 0)), 1 ); /* 41 */
28644  {
28645  USB.usbDevHandle = USB_DEVICE_Open ( USB_DEVICE_INDEX_0 , /* Open the device layer.*/
28647  if
28648  (
28649  USB.usbDevHandle != USB_DEVICE_HANDLE_INVALID
28650  ) /* If the device was opened,*/
28651  {
28652  ((int)(bitmapstruct.element3 |= (1 << 4))); /* 1 */
28653  {
28654  USB_DEVICE_EventHandlerSet ( USB.usbDevHandle ,/* Register a callback with device layer to get event*/
28655  USB_USBDeviceEventHandler , 0 ) ;/* notification (for end point 0).*/
28657  }
28658  ((int)(bitmapstruct.element3 |= (1 << 5))); /* 3 */
28659  }
28660  else /* The Device Layer is not ready to be opened. We should try*/
28661  {
28662  ((int)(bitmapstruct.element3 |= (1 << 6))); /* 2 */
28663  {
28664  /* again later.*/
28665  /*Comment.*/
28666  }
28667  }
28668  }
28669  ((int)(bitmapstruct.element3 |= (1 << 7))); /* 16 */
28670  goto l128584 ;
28672  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 8) : 0)), 1 ); /* 41 */
28673  {
28674  ((int)(bitmapstruct.element3 |= (1 << 9))); /* 23 */
28675 
28676  usb_watchdog () ;
28677  if
28678  (
28679  USB.deviceIsConfigured == true
28680  ) /* Check if the device is configured.*/
28681  {
28682  ((int)(bitmapstruct.element3 |= (1 << 10))); /* 1 */
28683  {
28684  if
28685  (
28686  USB_DEVICE_ActiveSpeedGet ( USB.usbDevHandle ) == USB_SPEED_FULL
28687  ) /* If the speed has been set to full,*/
28688  {
28689  ((int)(bitmapstruct.element3 |= (1 << 11))); /* 1 */
28690  {
28691  endpointSize = 64 ; /* set the endpoint size to 64.*/
28692  }
28693  ((int)(bitmapstruct.element3 |= (1 << 12))); /* 3 */
28694  }
28695  else
28696  {
28697  ((int)(bitmapstruct.element3 |= (1 << 13))); /* 2 */
28698  {
28699  if
28700  (
28701  USB_DEVICE_ActiveSpeedGet ( USB.usbDevHandle ) == USB_SPEED_HIGH
28702  ) /* Otherwise, if the speed has been set to high,*/
28703  {
28704  ((int)(bitmapstruct.element3 |= (1 << 14))); /* 1 */
28705  {
28706  endpointSize = 512 ;/* set the endpoint size to 512.*/
28707  }
28708  ((int)(bitmapstruct.element3 |= (1 << 15))); /* 3 */
28709  }
28710  else
28711  {
28712  ((int)(bitmapstruct.element3 |= (1 << 16))); /* 2 */
28713  {
28714  /*Comment.*/
28715  }
28716  }
28717  /* LDRA_INSPECTED 433 S
28718 */ /* MPLAB Harmony generated function.*/
28719  }
28720  }
28721  if
28722  (
28723  USB_DEVICE_EndpointIsEnabled ( USB.usbDevHandle , /* If the receive endpoint has not been enabled,*/
28724  USB.endpointRx ) == false
28725  )
28726  {
28727  ((int)(bitmapstruct.element3 |= (1 << 17))); /* 1 */
28728  {
28729  USB_DEVICE_EndpointEnable ( USB.usbDevHandle , 0 , USB.endpointRx ,/* Enable Read Endpoint for bulk transfers.*/
28730  USB_TRANSFER_TYPE_BULK , endpointSize ) ;
28731  }
28732  } else ((int)(bitmapstruct.element3 |= (1 << 18))); /* 4 */
28733  /* LDRA_INSPECTED 433 S
28734 */ /* MPLAB Harmony generated function.*/
28735  if
28736  (
28737  USB_DEVICE_EndpointIsEnabled ( USB.usbDevHandle , /* If the transmit endpoint has not been enabled,*/
28738  USB.endpointTx ) == false
28739  )
28740  {
28741  ((int)(bitmapstruct.element3 |= (1 << 19))); /* 1 */
28742  {
28743  USB_DEVICE_EndpointEnable ( USB.usbDevHandle , 0 , USB.endpointTx ,/* Enable Write Endpoint for bulk transfers.*/
28744  USB_TRANSFER_TYPE_BULK , endpointSize ) ;
28745  }
28746  } else ((int)(bitmapstruct.element3 |= (1 << 20))); /* 4 */
28747  USB.epDataReadPending = true ; /* Indicate that we are waiting for read */
28748  USB_DEVICE_EndpointRead ( USB.usbDevHandle , & USB.readTranferHandle ,/* Place a new read request. */
28749  USB.endpointRx , & receivedDataBuffer[ 0 ] , sizeof ( receivedDataBuffer ) ) ;
28750  USB.state = USB_STATE_READ ; /* Device is ready to run the read task */
28751  }
28752  } else ((int)(bitmapstruct.element3 |= (1 << 21))); /* 4 */
28753  }
28754  ((int)(bitmapstruct.element3 |= (1 << 22))); /* 16 */
28755  goto l128584 ;
28756  case USB_STATE_READ :
28757  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 23) : 0)), 1 ); /* 41 */
28758  {
28759  ((int)(bitmapstruct.element3 |= (1 << 24))); /* 23 */
28760 
28761  usb_watchdog () ;
28762  if
28763  (
28764  USB.deviceIsConfigured == false
28765  ) /* This means the device got de-configured. Change the*/
28766  {
28767  ((int)(bitmapstruct.element3 |= (1 << 25))); /* 1 */
28768  { /* application state back to waiting for configuration.*/
28770  USB_DEVICE_EndpointDisable ( USB.usbDevHandle , USB.endpointRx ) ;/* Disable the receive endpoint.*/
28771  USB_DEVICE_EndpointDisable ( USB.usbDevHandle , USB.endpointTx ) ;/* Disable the transmit endpoint.*/
28772  USB.epDataReadPending = false ; /* Reset the flag to show no read is occurring.*/
28773  USB.epDataWritePending = false ; /* Reset the flag to show no write is occurring.*/
28774  }
28775  ((int)(bitmapstruct.element3 |= (1 << 26))); /* 3 */
28776  }
28777  else
28778  {
28779  ((int)(bitmapstruct.element3 |= (1 << 27))); /* 2 */
28780  {
28781  if
28782  (
28783  USB.epDataReadPending == false
28784  ) /* If we have received data,*/
28785  {
28786  ((int)(bitmapstruct.element3 |= (1 << 28))); /* 1 */
28787  {
28788  usb_tick_count = 0U ;
28789  USB.tick = false ;/* Reset the timer tick.*/
28790  if
28791  (
28793  ) /* transfer the data to the RxFifo buffer.*/
28794  {
28795  ((int)(bitmapstruct.element3 |= (1 << 29))); /* 1 */
28796  {
28797  ( void ) Fifo_Put ( & RX_FIFO , receivedDataBuffer[ USB.byte_count ] ) ;/* put the byte into the RxFifo for later analysis.*/
28798  USB.byte_count = USB.byte_count + 1U ;
28799  }
28800  ((int)(bitmapstruct.element3 |= (1 << 30))); /* 3 */
28801  }
28802  else
28803  {
28804  ((int)(bitmapstruct.element3 |= (1 << 31))); /* 2 */
28805  {
28806  if
28807  (
28809  ) /* If we have received enough bytes,*/
28810  {
28811  ((int)(bitmapstruct.element4 |= (1 << 0))); /* 1 */
28812  {
28813  USB.byte_count = 0U ;/* reset the counter.*/
28814  if
28815  (
28816  Fifo_Length ( & RX_FIFO ) == CMD.cmd_size
28817  ) /* If we have received enough bytes for a command,*/
28818  {
28819  ((int)(bitmapstruct.element4 |= (1 << 1))); /* 1 */
28820  {
28821  COMM.state = COMM_STATE_VALIDATE ;/* move on to see if it is a valid command in commmodule.c.*/
28822  }
28823  } else ((int)(bitmapstruct.element4 |= (1 << 2))); /* 4 */
28824  USB.state = USB_STATE_WAIT ;/* move on to wait for the command to be processed.*/
28825  }
28826  ((int)(bitmapstruct.element4 |= (1 << 3))); /* 3 */
28827  }
28828  else
28829  {
28830  ((int)(bitmapstruct.element4 |= (1 << 4))); /* 2 */
28831  {
28832  /*MISRA compliance.*/
28833  }
28834  }
28835  }
28836  }
28837  }
28838  ((int)(bitmapstruct.element4 |= (1 << 5))); /* 3 */
28839  }
28840  else
28841  {
28842  ((int)(bitmapstruct.element4 |= (1 << 6))); /* 2 */
28843  {
28844  /*MISRA compliance.*/
28845  }
28846  }
28847  }
28848  }
28849  }
28850  ((int)(bitmapstruct.element4 |= (1 << 7))); /* 16 */
28851  goto l128584 ;
28852  case USB_STATE_WAIT :
28853  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 8) : 0)), 1 ); /* 41 */
28854  /* Wait here to process a command before sending response.*/
28855  { /* State will move to WRITE from commmodule.c.*/
28856  }
28857  ((int)(bitmapstruct.element4 |= (1 << 9))); /* 16 */
28858  goto l128584 ;
28859  case USB_STATE_WRITE :
28860  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 10) : 0)), 1 ); /* 41 */
28861  {
28862  ((int)(bitmapstruct.element4 |= (1 << 11))); /* 23 */
28863 
28864  usb_watchdog () ;
28865  if
28866  (
28868  ) /* This means the device got de-configured. Change the*/
28869  {
28870  ((int)(bitmapstruct.element4 |= (1 << 12))); /* 1 */
28871  { /* application state back to waiting for configuration.*/
28873  USB_DEVICE_EndpointDisable ( USB.usbDevHandle , USB.endpointRx ) ;/* Disable the endpoints.*/
28874  USB_DEVICE_EndpointDisable ( USB.usbDevHandle , USB.endpointTx ) ;
28875  USB.epDataReadPending = false ;
28876  USB.epDataWritePending = false ;
28877  }
28878  ((int)(bitmapstruct.element4 |= (1 << 13))); /* 3 */
28879  }
28880  else
28881  {
28882  ((int)(bitmapstruct.element4 |= (1 << 14))); /* 2 */
28883  {
28884  if
28885  (
28886  USB.epDataWritePending == false
28887  ) /* If we are not currently writing any data to the host,*/
28888  {
28889  ((int)(bitmapstruct.element4 |= (1 << 15))); /* 1 */
28890  {
28891  usb_tick_count = 0U ;
28892  data_sent = true ;
28893  USB.tick = false ;
28894  if
28895  (
28897  )
28898  {
28899  ((int)(bitmapstruct.element4 |= (1 << 16))); /* 1 */
28900  {
28901  transmitDataBuffer[ USB.byte_count ] = Fifo_Get ( & TX_FIFO ) ;/* Place the data to write into the transmit DataBufer.*/
28902  USB.byte_count = USB.byte_count + 1U ;
28903  }
28904  ((int)(bitmapstruct.element4 |= (1 << 17))); /* 3 */
28905  }
28906  else
28907  {
28908  ((int)(bitmapstruct.element4 |= (1 << 18))); /* 2 */
28909  {
28910  if
28911  (
28913  )
28914  {
28915  ((int)(bitmapstruct.element4 |= (1 << 19))); /* 1 */
28916  {
28917  USB.byte_count = 0U ;/* Reset the count.*/
28918  USB.epDataWritePending = true ;/* Set this flag to show we are about to write the data to the host.*/
28919  USB_DEVICE_EndpointWrite ( USB.usbDevHandle ,/* Write the data to the host.*/
28920  & USB.writeTranferHandle , USB.endpointTx , & transmitDataBuffer[ 0 ] , sizeof ( transmitDataBuffer ) , USB_DEVICE_TRANSFER_FLAGS_MORE_DATA_PENDING ) ;
28922  }
28923  ((int)(bitmapstruct.element4 |= (1 << 20))); /* 3 */
28924  }
28925  else
28926  {
28927  ((int)(bitmapstruct.element4 |= (1 << 21))); /* 2 */
28928  {
28929  /*MISRA compliance.*/
28930  }
28931  }
28932  }
28933  }
28934  }
28935  ((int)(bitmapstruct.element4 |= (1 << 22))); /* 3 */
28936  }
28937  else
28938  {
28939  ((int)(bitmapstruct.element4 |= (1 << 23))); /* 2 */
28940  {
28941  /*MISRA compliance.*/
28942  }
28943  }
28944  }
28945  }
28946  }
28947  ((int)(bitmapstruct.element4 |= (1 << 24))); /* 16 */
28948  goto l128584 ;
28950  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 25) : 0)), 1 ); /* 41 */
28951  {
28952  ((int)(bitmapstruct.element4 |= (1 << 26))); /* 23 */
28953 
28954  usb_watchdog () ;
28955  if
28956  (
28958  ) /* This means the device got de-configured. Change the*/
28959  {
28960  ((int)(bitmapstruct.element4 |= (1 << 27))); /* 1 */
28961  { /* application state back to waiting for configuration.*/
28963  USB_DEVICE_EndpointDisable ( USB.usbDevHandle , USB.endpointRx ) ;/* Disable the endpoints.*/
28964  USB_DEVICE_EndpointDisable ( USB.usbDevHandle , USB.endpointTx ) ;
28965  USB.epDataReadPending = false ;
28966  USB.epDataWritePending = false ;
28967  }
28968  ((int)(bitmapstruct.element4 |= (1 << 28))); /* 3 */
28969  }
28970  else
28971  {
28972  ((int)(bitmapstruct.element4 |= (1 << 29))); /* 2 */
28973  {
28974  if
28975  (
28976  USB.epDataWritePending == false
28977  ) /* If we are not currently writing any data to the host,*/
28978  {
28979  ((int)(bitmapstruct.element4 |= (1 << 30))); /* 1 */
28980  {
28981  USB.epDataReadPending = true ;/* Indicate that we are waiting for read.*/
28982  USB_DEVICE_EndpointRead ( USB.usbDevHandle , & USB.readTranferHandle ,/* Place a new read request.*/
28983  USB.endpointRx , & receivedDataBuffer[ 0 ] , sizeof ( receivedDataBuffer ) ) ;
28984  USB.state = USB_STATE_READ ;/* Device is ready to run the read task.*/
28985  }
28986  ((int)(bitmapstruct.element4 |= (1 << 31))); /* 3 */
28987  }
28988  else
28989  {
28990  ((int)(bitmapstruct.element5 |= (1 << 0))); /* 2 */
28991  {
28992  /*MISRA compliance.*/
28993  }
28994  }
28995  }
28996  }
28997  }
28998  ((int)(bitmapstruct.element5 |= (1 << 1))); /* 16 */
28999  goto l128584 ;
29000  case USB_STATE_ERROR :
29001  ((bitmapstruct.element5 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 2) : 0)), 1 ); /* 41 */
29002  {
29003  /*MISRA compliance.*/
29004  }
29005  ((int)(bitmapstruct.element5 |= (1 << 3))); /* 16 */
29006  goto l128584 ;
29007  default :
29008  ((bitmapstruct.element5 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 4) : 0)), 1 ); /* 41 */
29009  {
29010  /*Comment.*/
29011  }
29012  ((int)(bitmapstruct.element5 |= (1 << 5))); /* 16 */
29013  goto l128584 ;
29014  }
29015 l128584 :
29016  ; /* 18 */
29017  ((int)(bitmapstruct.element5 |= (1 << 6))); /* 30 */
29018  USB_62zqendz ( 167 ) ; /* 30 */
29019  }
29020 /**************************************************************************************/
29021 /**************************************************************************************/
29022 /* Section: Local Functions */
29023 /**************************************************************************************/
29024 /**************************************************************************************/
29025 /*!*************************************************************************************
29026  Function:
29027  static void usb_watchdog(void)
29028  Summary:
29029  Function to initialize Manchester parameters.
29030  Remarks:
29031  Refer to the man.h interface header for function usage details.
29032  */
29033 
29034 static void
29035  usb_watchdog ( void )
29036  {
29037  int izzqqzz=((int)(bitmapstruct.element5 |= (1 << 7))); /* 37 */
29038  if
29039  ( /* 50 */
29040  (
29041 
29042  ( /* 52 */
29043  (
29044  USB.tick == true
29045  )
29046  ? (bitmapstruct.element5 |= (1 << 8 ), 1)
29047  : (bitmapstruct.element5 |= (1 << 9 ), 0) ) /* 54 */
29048  &&
29049  ( data_sent == true )
29050  )
29051  ) /* 1 */
29052  {
29053  ((int)(bitmapstruct.element5 |= (1 << 10))); /* 1 */
29054  {
29055  usb_tick_count ++ ;
29056  USB.tick = false ;
29057  }
29058  } else ((int)(bitmapstruct.element5 |= (1 << 11))); /* 4 */
29059  if
29060  ( /* 50 */
29061  (
29062 
29063  ( /* 52 */
29064  (
29065  usb_tick_count == 2U
29066  )
29067  ? (bitmapstruct.element5 |= (1 << 12 ), 1)
29068  : (bitmapstruct.element5 |= (1 << 13 ), 0) ) /* 54 */
29069  &&
29070  ( USB.attached == true )
29071  )
29072  ) /* 1 */
29073  {
29074  ((int)(bitmapstruct.element5 |= (1 << 14))); /* 1 */
29075  {
29076  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 ) ;
29077  USB_DEVICE_Detach ( USB.usbDevHandle ) ;
29078  USB.tick = false ;
29079  }
29080  } else ((int)(bitmapstruct.element5 |= (1 << 15))); /* 4 */
29081  if
29082  (
29083  usb_tick_count == 5U
29084  )
29085  {
29086  ((int)(bitmapstruct.element5 |= (1 << 16))); /* 1 */
29087  {
29088  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 ) ;
29089  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 ) ;
29090  USB_DEVICE_Attach ( USB.usbDevHandle ) ;/* Attach the USB connection.*/
29091  USB.tick = false ;/* Reset the timer tick.*/
29092  }
29093  } else ((int)(bitmapstruct.element5 |= (1 << 17))); /* 4 */
29094  if
29095  (
29096  usb_tick_count == 30U
29097  )
29098  {
29099  ((int)(bitmapstruct.element5 |= (1 << 18))); /* 1 */
29100  {
29101  usb_tick_count = 0U ;
29102  USB.tick = false ;/* Reset the timer tick.*/
29103  }
29104  } else ((int)(bitmapstruct.element5 |= (1 << 19))); /* 4 */
29105  ((int)(bitmapstruct.element5 |= (1 << 20))); /* 30 */
29106  USB_62zqendz ( 181 ) ; /* 30 */
29107  }
29108 /***************************************************************************************
29109  End of File
29110  */
29111 #define qqqbranches 181
29112 #define QQQMAXMCDCSIZE 2
29113 /********************** LDRA_PORT INSTRUMENTATION **********************/
29114 
29115 /******************* END OF LDRA_PORT INSTRUMENTATION ******************/
29116 #define ldra_sscanf
29117  /* put in undefs to protect our parameter names from macros */
29118 #undef f
29119 #undef i
29120 #undef j
29121 #undef k
29122 #undef s
29123 #undef l
29124 #undef ii
29125 #undef some
29126 #undef none
29127 #undef from
29128 #undef a
29129 #undef b
29130 #undef iz
29131 #undef jz
29132 #undef qqnull_params
29133 #define qqnull_params void
29134  /* Conventional Instrumentation */
29135 #define qqzzidfield 1
29136  /* single file or fileid */
29137  /* these have an extra field for the fileid */
29138  static char qqqqone[] = "%6d\n"; /* single point */
29139  /* uncompressed data structures */
29140  /* uncompressed bitmap */
29141 #define QQQFIXEDSIZE
29142  static int qqqlast = 0;
29143  extern int qqupload_registered;
29144  extern int USB_62zqqzqz(qqnull_params);
29145  extern int USB_62zqqzqz1(qqnull_params);
29146  /* ----------------------------------------------------------------------* 200 *
29147  * Procedures
29148  * -----------------------------------------------------------------------------
29149  */
29150  /* ----------- zscanf ---------------------------------------------------* 201 *
29151  * Returns an integer extracted from a string
29152  * -----------------------------------------------------------------------------
29153  */
29154  static int USB_62zscanf(char * qqscan_str)
29155  {
29156  int qqvalue;
29157  int qqisign;
29158  char * qqcptr;
29159  qqvalue = 0;
29160  qqisign = 1;
29161  qqcptr = qqscan_str;
29162  /* Skip spaces */
29163  while (qqcptr[0] == ' ')
29164  {
29165  qqcptr++;
29166  }
29167  /* Check for a leading ---
29168  */
29169  if (qqcptr[0] == '-')
29170  {
29171  qqisign = -1;
29172  qqcptr++;
29173  }
29174  /* Extract digits */
29175  while ((qqcptr[0] >= '0') && (qqcptr[0] <= '9'))
29176  {
29177  qqvalue = 10 * qqvalue;
29178  qqvalue = qqvalue + (qqcptr[0] - '0');
29179  qqcptr++;
29180  }
29181  qqvalue = qqisign * qqvalue;
29182  return qqvalue;
29183  } /* end of zscanf */
29184  /* ----------------------------------------------------------------------* 210 *
29185  * C System utilities in use:
29186  * fprintf
29187  * fclose
29188  * sscanf
29189  * -----------------------------------------------------------------------------
29190  */
29191  /* ----------------------------------------------------------------------* 213 *
29192  * qqoutput* suite
29193  * Main output routines. These may require modification.
29194  * -----------------------------------------------------------------------------
29195  */
29196  /* ----------------------------------------------------------------------* 214 *
29197  * qqoutput
29198  * This is the principle output routine.
29199  * -----------------------------------------------------------------------------
29200  */
29201  static void qqoutput(FILEPOINT char * s,int i)
29202  /* f - file pointer, s - format string, i - integer for probe value */
29203  {
29204  /* printing to a file */
29205  /* fprintf exists, not threaded */
29206  /* fprintf exists, not threaded, ( SINGLEFILE or FILEID ) */
29207  ldra_sprintf2 (&ldra_buffer[0], s,i,zzfileid);
29208  ldra_port_write (&ldra_buffer[0]);
29209  } /* end of qqoutput */
29210  /* ----------------------------------------------------------------------* 215 *
29211  * qqoutput0
29212  * -----------------------------------------------------------------------------
29213  */
29214  static void qqoutput0(FILEPOINT char * s)
29215  {
29216  ldra_port_write(s);
29217  } /* end of qqoutput0 */
29218  /* ----------------------------------------------------------------------* 216 *
29219  * qqoutput2
29220  * -----------------------------------------------------------------------------
29221  */
29222  static void qqoutput2(FILEPOINT char * s,int i, int j)
29223  {
29224  ldra_sprintf2 (&ldra_buffer[0], s, i, j);
29225  ldra_port_write (&ldra_buffer[0]);
29226  } /* end of qqoutput2 */
29227  /* ----------------------------------------------------------------------* 217 *
29228  * qqoutput3
29229  * -----------------------------------------------------------------------------
29230  */
29231  static void qqoutput3(FILEPOINT char * s,int i,int j,int k)
29232  {
29233  ldra_sprintf3 (&ldra_buffer[0], s, i, j, k);
29234  ldra_port_write (&ldra_buffer[0]);
29235  } /* end of qqoutput3 */
29236  /* ----------------------------------------------------------------------* 218 *
29237  * qqoutput4
29238  * -----------------------------------------------------------------------------
29239  */
29240  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l)
29241  {
29242  ldra_sprintf4 (&ldra_buffer[0], s, i, j, k, l);
29243  ldra_port_write (&ldra_buffer[0]);
29244  } /* end of qqoutput4 */
29245  /* ----------------------------------------------------------------------* 219 *
29246  * end of qqoutput* suite
29247  * -----------------------------------------------------------------------------
29248  */
29249  /* ----------------------------------------------------------------------* 222 *
29250  * qqqqinitialise
29251  * This procedure initialises the structures for
29252  * compressed execution histories.
29253  * -----------------------------------------------------------------------------
29254  */
29255  static void qqqqinitialise(int ii)
29256  {
29257  unsigned int i;
29258  /* First time through. */
29259  /* bitmap */
29260  /* bitmap separate */
29261  qqqlast = 1; /* stops qqfun() calling initialise again */
29262  /* bitmap */
29263  /* bitmap singlefile */
29264  /* struct singlefile notmainfl */
29265  } /* end of qqqqinitialise */
29266 /* ----------------------------------------------------------------------* 225 *
29267 * qqqbitmapreset
29268 * This procedure resets the structures for
29269 * compressed execution histories.
29270 * -----------------------------------------------------------------------------
29271 */
29272 static void qqqbitmapreset()
29273 {
29274 struct bitmapstruct_t localbitmap = {0};
29275 bitmapstruct = localbitmap;
29276 } /* end of qqqbitmapreset */
29277 #undef QQQTEMP1
29278 #define QQQTEMP1
29279  /* ----------- zqqzqz ---------------------------------------------------* 310 *
29280  * -----------------------------------------------------------------------------
29281  */
29282  /* ----------------------------------------------------------------------* 312 *
29283  * This routine opens the execution history file. It is instrumented at the
29284  * start of the main program if one exists in the file. In general this is
29285  * superceded by USB_62zqqzqz1 below.
29286  * -----------------------------------------------------------------------------
29287  */
29289  {
29290  if ( USB_62zzopen != 1 )
29291  {
29292 #undef QQQMUSTOPEN
29293  USB_62zzopen = 1;
29294  }
29295  return(1);
29296  } /* end of zqqzqz */
29297  /* ----------- zqqzqz1 --------------------------------------------------* 315 *
29298  * -----------------------------------------------------------------------------
29299  */
29300  /* ----------------------------------------------------------------------* 317 *
29301  * This routine also opens the execution history file. It is called
29302  * automatically if a probe fires and the execution history is not already
29303  * opened (USB_62zzopen = 0 ).
29304  * Because this always works ( it was intended for files with no main program
29305  * it is now the de facto common way to open the execution history.
29306  * -----------------------------------------------------------------------------
29307  */
29309  {
29310  if ( USB_62zzopen != 1 )
29311  {
29312  ldra_port_open(); /* 7 */
29313  qqqqinitialise(0);
29314  USB_62zzopen = 1;
29315  }
29316  return(1);
29317  } /* end of zqqzqz1 */
29318  /* ----------- zqendz ---------------------------------------------------* 330 *
29319  * This routine is called on exiting a routine in a
29320  * module. It closes the execution history.
29321  * -----------------------------------------------------------------------------
29322  */
29323 static int USB_62zqendz(int qqqi)
29324  {
29325  if (!qqqstructzzopen)
29326  {
29328  qqqstructzzopen = 1;
29329  }
29330  if ( USB_62zzopen != 1 )
29331  {
29332  USB_62zqqzqz1();
29333  }
29334  /* ----------------------------------------------------------------------* 331 *
29335  * this is the one which puts an integer into
29336  * the execution history file and returns unity.
29337  * The format of each field consists of six columns,
29338  * the number is right justified in this field.
29339  * -----------------------------------------------------------------------------
29340  */
29341  if ( USB_62zzopen )
29342  {
29343  /* uncompressed */
29344  /* uncompressed unbuffered */
29345  /* uncompressed unbuffered bitmap */
29346  if ( qqqi > 0 )
29347  {
29348  }
29349  else
29350  {
29351  }
29352  }
29353  qqqlast = 0;
29354  return(1);
29355  } /* end of zqendz */
29356  /* ----------------------------------------------------------------------* 335 *
29357  * Output structure - qqbmsoutput
29358  * -----------------------------------------------------------------------------
29359  */
29360  static void qqbmsoutput(FILEPOINT char * s, unsigned int i)
29361  {
29362  static int branches_printed = 0;
29363  int b, last = 0;
29364  for(b=0;b<qqqqbmselwidth/8;b++)
29365  {
29366  ldra_sprintf1 (&ldra_buffer[0], s, (i >> last) & ~(~0 << 8));
29367  ldra_port_write (&ldra_buffer[0]);
29368  ldra_sprintf1 (&ldra_buffer[0], "%8d\n", zzfileid );
29369  ldra_port_write (&ldra_buffer[0]);
29370  last += 8;
29371  branches_printed += 8;
29372  if (branches_printed >= qqqbranches)
29373  {
29374  /* do not print any more, can be left over when using more than 8 bits to store bitmap */
29375  break;
29376  }
29377  }
29378  }
29379  /* ----------------------------------------------------------------------* 336 *
29380  * qqqupload
29381  * This routine loops through the stored bitmap and
29382  * outputs it. It then uploads the stored mcdc.
29383  * -----------------------------------------------------------------------------
29384  */
29385  static void qqqupload(qqnull_params)
29386  {
29387  int i;
29388  /* uncompressed bitmap (!singlefile or mainfl) separate */
29389  {
29390  USB_62zqqzqz1();
29391 #define ELEMENT(N) qqbmsoutput("%8d", bitmapstruct.element##N);
29392 #define LASTELEMENT
29393 #include "USB_62zbelem.def"
29394 #undef LASTELEMENT
29395 #undef ELEMENT
29396  }
29397  /* bitmap separate */
29398  qqqlast = 1; /* stops qqfun() calling initialise again */
29399  } /* end of qqqupload */
29400  /* ----------- zqzqzq ---------------------------------------------------* 342 *
29401  * -----------------------------------------------------------------------------
29402  */
29403  /* ----------------------------------------------------------------------* 344 *
29404  * This routine should be called before the program
29405  * terminates. It closes the execution history
29406  * -----------------------------------------------------------------------------
29407  */
29408  static int USB_62zqzqzq(int qqqi)
29409  {
29410  if ( USB_62zzopen != 1 )
29411  {
29412  USB_62zqqzqz1();
29413  }
29414  /* not compressed */
29415  /* do nothing for bitmap*/
29416  /* upload the history */
29417  /* bitmap */
29418  /* uncompressed bitmap */
29419  USB_62zqendz(qqqi);
29420  /* qqqupload closes the execution history file */
29421  return(1);
29422  } /* end of zqzqzq */
29423  /* the following routines should be left alone */
29424 /* END OF TESTBED INSTRUMENTATION */
29425 
static int qqqstructzzopen
Definition: inszt_USB.c:137
#define FILEPOINT
Definition: inszt_USB.c:92
void SYS_PORTS_InterruptEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_INTERRUPT_TYPE pinInterruptType)
uint32_t DRV_TMR2_CounterFrequencyGet(void)
bool PLIB_PORTS_ExistsPinChangeNotice(PORTS_MODULE_ID index)
APP_DATA APP
Definition: app.c:73
uint8_t byte_count
Definition: inszt_app.c:30511
void DRV_TMR_Close(DRV_HANDLE handle)
bool Valid_Command(uchar8_t msg)
Definition: commands.c:1111
bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
void PLIB_DMA_CRCAppendModeDisable(DMA_MODULE_ID index)
SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT *const init)
static DRV_TMR_OPERATION_MODE DRV_TMR4_OperationModeGet(void)
Definition: inszt_USB.c:4090
bool PLIB_SPI_ExistsAudioProtocolMode(SPI_MODULE_ID index)
void SYS_PORTS_ChangeNotificationInIdleModeEnable(PORTS_MODULE_ID index)
SPI_BAUD_RATE_CLOCK baudClockSource
Definition: inszt_adc.c:26566
static void Execute_System(void)
DRV_USART_BUFFER_RESULT
Definition: inszt_USB.c:15033
static int USB_62zqendz(int qqqi)
Definition: inszt_USB.c:29323
bool PLIB_SPI_ExistsBaudRateClock(SPI_MODULE_ID index)
static int USB_62zqqzqz(qqnull_params)
Definition: inszt_USB.c:29288
DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void DRV_TMR3_DeInitialize(void)
Definition: inszt_USB.c:3949
DRV_HANDLE DRV_SPI_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT ioIntent)
DRV_USART_OPERATION_MODE
Definition: inszt_USB.c:14974
bool PLIB_SPI_ExistsFrameSyncPulseDirection(SPI_MODULE_ID index)
PORTS_DATA_MASK SYS_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_USART_TransmitterIdleIsLowEnable(USART_MODULE_ID index)
void PLIB_SPI_FrameSyncPulseEdgeSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_EDGE edge)
void SYS_DMA_Suspend(void)
void PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
bool PLIB_DMA_ChannelXINTSourceIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
bool PLIB_SPI_ExistsTransmitBufferFullStatus(SPI_MODULE_ID index)
void PLIB_USART_BaudRateHighSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
PORTS_DATA_MASK PLIB_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index, USART_HANDSHAKE_MODE handshakeConfig)
COMMAND_STATES
Definition: commands.h:62
void PLIB_DMA_ChannelXAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_ADDRESSING_MODE channelAddressMode)
int16_t PLIB_USART_Receiver9BitsReceive(USART_MODULE_ID index)
bool PLIB_SPI_ExistsFrameSyncPulseEdge(SPI_MODULE_ID index)
uint8_t cmd_size
Definition: commands.h:76
bool PLIB_USART_ExistsReceiverEnable(USART_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXTransferCountGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool DRV_ADC_SamplesAvailable(uint8_t bufIndex)
void PLIB_SPI_CommunicationWidthSelect(SPI_MODULE_ID index, SPI_COMMUNICATION_WIDTH width)
void DRV_USART_ByteTransmitCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXStartIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQnum)
bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
SYS_DMA_CRC_WRITE_ORDER
Definition: inszt_USB.c:13273
void PLIB_DMA_CRCDataWrite(DMA_MODULE_ID index, uint32_t DMACRCdata)
bool PLIB_DMA_CRCIsEnabled(DMA_MODULE_ID index)
void DRV_ADC_Stop(void)
uint32_t DRV_TMR0_CounterFrequencyGet(void)
void PLIB_DMA_BusyActiveReset(DMA_MODULE_ID index)
void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
DRV_USART_BAUD_SET_RESULT DRV_USART0_BaudSet(uint32_t baud)
static void qqoutput(FILEPOINT char *s, int i)
Definition: inszt_USB.c:29201
uint16_t PORTS_DATA_MASK
Definition: inszt_adc.c:18519
uint8_t Fifo_Get(TFifo *ptrFifo)
Definition: fifo.c:160
bool PLIB_USART_ExistsBRGClockSourceSelect(USART_MODULE_ID index)
void SYS_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SPI_FRAME_PULSE_POLARITY framePulsePolarity
Definition: inszt_adc.c:26551
#define qqqbranches
Definition: inszt_USB.c:29111
bool PLIB_DMA_ExistsChannelXPatternIgnoreByte(DMA_MODULE_ID index)
DRV_TMR_CLIENT_STATUS DRV_TMR1_ClientStatus(void)
void PLIB_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void DRV_PMP0_Initialize(void)
static void DRV_TMR0_Open(void)
Definition: inszt_USB.c:3639
bool PLIB_PORTS_ExistsChangeNotice(PORTS_MODULE_ID index)
DRV_USART_TRANSFER_STATUS
Definition: inszt_USB.c:15404
bool PLIB_DMA_ExistsChannelXINTSource(DMA_MODULE_ID index)
void PLIB_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
bool PLIB_SPI_ReceiverBufferIsFull(SPI_MODULE_ID index)
static int qqqlast
Definition: inszt_USB.c:29142
void SYS_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
static void Execute_Protocol_B(void)
static void Execute_Protocol_A(void)
bool PLIB_SPI_ExistsPinControl(SPI_MODULE_ID index)
void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
bool DRV_TMR0_Start(void)
uint8_t PLIB_SPI_BufferRead(SPI_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_PORTS_ExistsPinModePerPort(PORTS_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
void PLIB_USART_TransmitterEnable(USART_MODULE_ID index)
void PLIB_DMA_ChannelXSourceStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t sourceStartAddress)
DRV_TMR_CLIENT_STATUS DRV_TMR0_ClientStatus(void)
DRV_SPI_PROTOCOL_TYPE
Definition: inszt_adc.c:26367
bool PLIB_PORTS_ExistsChangeNoticePerPortTurnOn(PORTS_MODULE_ID index)
DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
DRV_USART_LINE_CONTROL_SET_RESULT
Definition: inszt_adc.c:15287
uint16_t PLIB_DMA_ChannelXCellSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_SPI_FramedCommunicationDisable(SPI_MODULE_ID index)
void PLIB_USART_IrDADisable(USART_MODULE_ID index)
SYS_MODULE_OBJ DRV_SPI_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
DRV_CLIENT_STATUS
Definition: inszt_USB.c:934
bool PLIB_USART_ExistsBaudRate(USART_MODULE_ID index)
bool PLIB_DMA_ExistsCRCData(DMA_MODULE_ID index)
void PLIB_USART_StopInIdleDisable(USART_MODULE_ID index)
void DRV_TMR1_Stop(void)
bool PLIB_USART_ExistsTransmitterEnable(USART_MODULE_ID index)
void DRV_TMR1_Initialize(void)
bool PLIB_DMA_ExistsChannelXDisabled(DMA_MODULE_ID index)
bool PLIB_USART_RunInSleepModeIsEnabled(USART_MODULE_ID index)
void PLIB_USART_ReceiverOverrunErrorClear(USART_MODULE_ID index)
DRV_USART_BUFFER_EVENT
Definition: inszt_USB.c:15011
void PLIB_PORTS_AnPinsModeSelect(PORTS_MODULE_ID index, PORTS_AN_PIN anPins, PORTS_PIN_MODE mode)
void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
void DRV_TMR3_CounterValueSet(uint32_t value)
static void DRV_TMR4_Tasks(void)
Definition: inszt_USB.c:4140
bool DRV_TMR1_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
void USB_USBDeviceEventHandler(USB_DEVICE_EVENT event, void *eventData, uintptr_t context)
Definition: USB.c:84
void DRV_ADC0_Close(void)
bool PLIB_PORTS_ExistsPortsWrite(PORTS_MODULE_ID index)
void PLIB_DMA_ChannelXChainToHigher(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_Enable(SPI_MODULE_ID index)
void DRV_TMR0_CounterClear(void)
bool PLIB_DMA_ExistsCRCChannel(DMA_MODULE_ID index)
DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus(DRV_HANDLE handle)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
bool PLIB_DMA_LastBusAccessIsRead(DMA_MODULE_ID index)
void PLIB_DMA_AbortTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_USART_HANDSHAKE
Definition: inszt_USB.c:15156
DRV_TMR_OPERATION_MODE DRV_TMR3_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
DRV_USART_LINE_CONTROL
Definition: inszt_adc.c:15315
void PLIB_SPI_FIFOEnable(SPI_MODULE_ID index)
static DRV_TMR_OPERATION_MODE DRV_TMR3_OperationModeGet(void)
Definition: inszt_USB.c:3980
static SYS_STATUS DRV_TMR2_Status(void)
Definition: inszt_USB.c:3848
static int USB_62zscanf(char *qqscan_str)
Definition: inszt_USB.c:29154
void PLIB_PORTS_CnPinsPullUpEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
bool PLIB_USART_BaudRateAutoDetectIsComplete(USART_MODULE_ID index)
uint8_t PLIB_USART_AddressGet(USART_MODULE_ID index)
bool DepthStatus
Definition: commands.c:204
DRV_USART_BAUD_SET_RESULT
Definition: inszt_adc.c:15266
bool PLIB_USART_TransmitterBufferIsFull(USART_MODULE_ID index)
void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index, SPI_INPUT_SAMPLING_PHASE phase)
bool PLIB_DMA_ExistsChannelXCellProgressPointer(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXINTSourceFlag(DMA_MODULE_ID index)
void Init_Fifo(void)
Definition: fifo.c:100
void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
bool PLIB_DMA_ExistsCRCPolynomialLength(DMA_MODULE_ID index)
Definition: fifo.h:59
bool PLIB_SPI_IsBusy(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsStopInIdle(DMA_MODULE_ID index)
uint8_t receivedDataBuffer [64] __attribute__((coherent))
Definition: inszt_USB.c:28401
bool PLIB_USART_ReceiverIsIdle(USART_MODULE_ID index)
void DRV_USART0_TasksError(void)
bool PLIB_SPI_ExistsFIFOCount(SPI_MODULE_ID index)
uint32_t PLIB_DMA_ChannelXSourceStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_SPI_ExistsReceiveBufferStatus(SPI_MODULE_ID index)
COMM_STATES
Definition: commmodule.h:55
SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
DRV_TMR_OPERATION_MODE DRV_TMR4_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_ExistsChannelBits(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXBusy(DMA_MODULE_ID index)
PORTS_DATA_TYPE PLIB_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_DMA_CRCEnable(DMA_MODULE_ID index)
uint8_t jobQueueReserveSize
Definition: inszt_adc.c:26596
bool PLIB_SPI_ExistsFIFOInterruptMode(SPI_MODULE_ID index)
void SYS_DMA_ChannelSetupMatchAbortMode(SYS_DMA_CHANNEL_HANDLE handle, uint16_t pattern, DMA_PATTERN_LENGTH length, SYS_DMA_CHANNEL_IGNORE_MATCH ignore, uint8_t ignorePattern)
DRV_TMR_CLIENT_STATUS
Definition: inszt_adc.c:1801
bool PLIB_USART_ExistsModuleBusyStatus(USART_MODULE_ID index)
static void DRV_TMR0_Close(void)
Definition: inszt_USB.c:3660
void PLIB_DMA_CRCPolynomialLengthSet(DMA_MODULE_ID index, uint8_t polyLength)
SYS_MODULE_INIT moduleInit
Definition: inszt_adc.c:26535
bool PLIB_DMA_ExistsChannelXSourceStartAddress(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXChainDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_USART_LoopbackDisable(USART_MODULE_ID index)
void DRV_TMR4_StopInIdleDisable(void)
SYS_DMA_CHANNEL_IGNORE_MATCH
Definition: inszt_USB.c:13231
void PLIB_DMA_CRCTypeSet(DMA_MODULE_ID index, DMA_CRC_TYPE CRCType)
void PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
static void DRV_TMR2_DeInitialize(void)
Definition: inszt_USB.c:3839
SYS_PORTS_PULLUP_PULLDOWN_STATUS
Definition: inszt_USB.c:21779
DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXPatternIgnoreSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint8_t pattern)
void PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_DMA_ChannelXChainToLower(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsTransmitter9BitsSend(USART_MODULE_ID index)
PORTS_DATA_TYPE SYS_PORTS_LatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_PORTS_ExistsLatchRead(PORTS_MODULE_ID index)
void DRV_TMR0_StopInIdleDisable(void)
#define USB_62zzopen
Definition: inszt_USB.c:77
PORTS_DATA_TYPE PLIB_PORTS_ReadLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_DMA_ExistsChannelX(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXStartIRQ(DMA_MODULE_ID index)
void DRV_TMR_Deinitialize(SYS_MODULE_OBJ object)
void PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
static DRV_TMR_OPERATION_MODE DRV_TMR2_OperationModeGet(void)
Definition: inszt_USB.c:3870
void SYS_DMA_Resume(void)
void PLIB_DMA_Disable(DMA_MODULE_ID index)
DRV_IO_INTENT
Definition: inszt_USB.c:890
static int qqqisinitialised
Definition: inszt_main.c:152
void PLIB_DMA_ChannelXPeripheralAddressSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t peripheraladdress)
bool PLIB_SPI_FrameErrorStatusGet(SPI_MODULE_ID index)
void PLIB_USART_ReceiverAddressDetectDisable(USART_MODULE_ID index)
DRV_SPI_TASK_MODE
Definition: inszt_adc.c:26444
bool PLIB_USART_ExistsReceiver(USART_MODULE_ID index)
DRV_USART_LINE_CONTROL
Definition: inszt_USB.c:15230
static void DRV_TMR4_Close(void)
Definition: inszt_USB.c:4100
void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
SYS_DMA_CHANNEL_CRC_MODE
Definition: inszt_USB.c:13250
void DRV_USART0_TasksTransmit(void)
void DRV_ADC_DeInitialize(void)
void PLIB_PORTS_DirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
static void DRV_TMR3_Open(void)
Definition: inszt_USB.c:3969
uint32_t DRV_TMR1_CounterFrequencyGet(void)
static void DRV_TMR1_Open(void)
Definition: inszt_USB.c:3749
void DRV_ADC_Initialize(void)
size_t DRV_USART_Write(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
void DRV_TMR_AlarmPeriodSet(DRV_HANDLE handle, uint32_t value)
uint32_t DRV_TMR0_CounterValueGet(void)
void PLIB_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
INT_SOURCE txInterruptSource
Definition: inszt_adc.c:26580
DRV_SPI_BUFFER_TYPE
Definition: inszt_adc.c:26344
void PLIB_USART_TransmitterByteSend(USART_MODULE_ID index, int8_t data)
unsigned int DRV_USART_TransmitBufferSizeGet(const DRV_HANDLE handle)
void PLIB_USART_TransmitterInterruptModeSelect(USART_MODULE_ID index, USART_TRANSMIT_INTR_MODE fifolevel)
uintptr_t DRV_USART_BUFFER_HANDLE
Definition: inszt_USB.c:14950
bool PLIB_USART_ExistsEnable(USART_MODULE_ID index)
void PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_MODULE_ID index)
void DRV_USART0_Close(void)
bool PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus(SPI_MODULE_ID index)
bool PLIB_DMA_CRCAppendModeIsEnabled(DMA_MODULE_ID index)
void DRV_IC_Stop(DRV_HANDLE handle)
PORTS_DATA_TYPE SYS_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void DRV_TMR3_Initialize(void)
uint32_t PLIB_DMA_CRCXOREnableGet(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXSourcePointer(DMA_MODULE_ID index)
void DRV_TMR1_CounterClear(void)
void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index, USART_LINECONTROL_MODE dataFlowConfig)
uint32_t SYS_DMA_ChannelCRCGet(void)
#define DRV_IC_Open(drvIndex, intent)
Definition: inszt_USB.c:1332
void DRV_TMR3_CounterClear(void)
DRV_SPI_BUFFER_EVENT
Definition: inszt_adc.c:26399
void DRV_TMR_CounterValueSet(DRV_HANDLE handle, uint32_t counterPeriod)
void PLIB_PORTS_DirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void DRV_TMR4_CounterValueSet(uint32_t value)
DRV_USART_TRANSFER_STATUS
Definition: inszt_adc.c:15489
DRV_TMR_OPERATION_MODE
Definition: inszt_adc.c:1848
void SYS_DEBUG_Reinitialize(SYS_MODULE_OBJ object, const SYS_MODULE_INIT *const init)
uint8_t DRV_PMP0_Read(void)
bool DRV_TMR2_Start(void)
DRV_SPI_TASK_MODE
Definition: inszt_USB.c:26359
void DRV_TMR_Tasks(SYS_MODULE_OBJ object)
SYS_DMA_CHANNEL_IGNORE_MATCH
Definition: inszt_adc.c:13316
SPI_FRAME_PULSE_DIRECTION framePulseDirection
Definition: inszt_adc.c:26553
void DRV_TMR3_PeriodValueSet(uint32_t value)
void DRV_TMR4_StopInIdleEnable(void)
SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
bool PLIB_DMA_ExistsStartTransfer(DMA_MODULE_ID index)
void PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_MODULE_ID index)
void PLIB_PORTS_ChangeNoticeDisable(PORTS_MODULE_ID index)
SYS_PORTS_PIN_DIRECTION
Definition: inszt_USB.c:21803
bool PLIB_DMA_ChannelXChainIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsTransmitterBufferFullStatus(USART_MODULE_ID index)
uintptr_t DRV_SPI_BUFFER_HANDLE
Definition: inszt_USB.c:26162
static void qqbmsoutput(FILEPOINT char *s, unsigned int i)
Definition: inszt_USB.c:29360
void SYS_PORTS_ChangeNotificationEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum, SYS_PORTS_PULLUP_PULLDOWN_STATUS value)
COMMAND_STATES
Definition: inszt_USB.c:27785
bool PLIB_DMA_IsEnabled(DMA_MODULE_ID index)
SYS_DMA_ERROR
Definition: inszt_adc.c:13491
SYS_DMA_ERROR
Definition: inszt_USB.c:13406
void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index, int8_t Mask)
uint32_t dummyByteValue
Definition: inszt_adc.c:26589
void PLIB_DMA_ChannelXBusyInActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsOutputDataPhase(SPI_MODULE_ID index)
SYS_DMA_SIDL
Definition: inszt_adc.c:13275
void APP_Initialize(void)
Definition: app.c:93
bool PLIB_USART_RunInOverflowIsEnabled(USART_MODULE_ID index)
void PLIB_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION outputFunction, PORTS_REMAP_OUTPUT_PIN remapOutputPin)
DMA_CRC_TYPE PLIB_DMA_CRCTypeGet(DMA_MODULE_ID index)
TMR_PRESCALE DRV_TMR4_PrescalerGet(void)
SYS_DMA_CHANNEL_CRC_MODE
Definition: inszt_adc.c:13335
void qqpopulate_array_fcn_ptrQQ(int x, ldra_void_function y, ldra_void_function z)
Definition: inszt_main.c:157
uint8_t PLIB_DMA_ChannelXPatternIgnoreGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsFrameSyncPulseCounter(SPI_MODULE_ID index)
DRV_SPI_BUFFER_TYPE
Definition: inszt_USB.c:26259
uintptr_t DRV_HANDLE
Definition: inszt_adc.c:1108
DRV_SPI_PROTOCOL_TYPE spiProtocolType
Definition: inszt_adc.c:26545
bool PLIB_USART_ReceiverFramingErrorHasOccurred(USART_MODULE_ID index)
bool DRV_TMR3_Start(void)
bool PLIB_DMA_ChannelXBufferedDataIsWritten(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXPatternDataSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t patternData)
SPI_FRAME_PULSE_WIDTH framePulseWidth
Definition: inszt_adc.c:26557
void PLIB_DMA_SuspendDisable(DMA_MODULE_ID index)
bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
static void qqoutput2(FILEPOINT char *s, int i, int j)
Definition: inszt_USB.c:29222
void PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool epDataReadPending
Definition: inszt_app.c:30505
void PLIB_USART_StopInIdleEnable(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsPinChangeNoticePerPort(PORTS_MODULE_ID index)
void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
void SYS_PORTS_ChangeNotificationPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
uint16_t PLIB_DMA_ChannelXSourcePointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
uint32_t baudRate
Definition: inszt_adc.c:26572
void SYS_PORTS_PinPullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_USART_CLIENT_STATUS
Definition: inszt_USB.c:15379
bool PLIB_SPI_ExistsFrameSyncPulsePolarity(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXAutoDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
static DRV_TMR_OPERATION_MODE DRV_TMR0_OperationModeGet(void)
Definition: inszt_USB.c:3650
void PLIB_SPI_FramedCommunicationEnable(SPI_MODULE_ID index)
void DRV_SPI_Close(DRV_HANDLE handle)
void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index, SPI_CLOCK_POLARITY polarity)
bool PLIB_DMA_ExistsChannelXDestinationPointer(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXNullWriteModeDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsReceiverAddressMask(USART_MODULE_ID index)
uint8_t PLIB_SPI_FIFOCountGet(SPI_MODULE_ID index, SPI_FIFO_TYPE type)
void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
void(* DRV_SPI_BUFFER_EVENT_HANDLER)(DRV_SPI_BUFFER_EVENT event, DRV_SPI_BUFFER_HANDLE bufferHandle, void *context)
Definition: inszt_USB.c:26430
void SYS_DEBUG_Message(const char *message)
void PLIB_DMA_ChannelXPatternLengthSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_PATTERN_LENGTH patternLen)
void SYS_DEBUG_Tasks(SYS_MODULE_OBJ object)
bool PLIB_DMA_ExistsCRCType(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsSlewRateControl(PORTS_MODULE_ID index)
bool PLIB_PORTS_ExistsPinMode(PORTS_MODULE_ID index)
void SYS_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_USART_TasksReceive(SYS_MODULE_OBJ object)
bool DRV_TMR1_Start(void)
void SYS_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
void PLIB_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
void PLIB_USART_LoopbackEnable(USART_MODULE_ID index)
void PLIB_DMA_ChannelXReloadDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ExistsChannelXPatternIgnore(DMA_MODULE_ID index)
unsigned char uchar8_t
Definition: commands.h:52
USB_ENDPOINT_ADDRESS endpointTx
Definition: inszt_app.c:30508
void SYS_DMA_ChannelTransferAdd(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
DRV_USART_INIT_FLAGS
Definition: inszt_USB.c:15279
bool PLIB_SPI_ExistsBuffer(SPI_MODULE_ID index)
void PLIB_DMA_StopInIdleEnable(DMA_MODULE_ID index)
void PLIB_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_SPI_ExistsClockPolarity(SPI_MODULE_ID index)
bool PLIB_USART_TransmitterIsEmpty(USART_MODULE_ID index)
SYS_PORTS_PIN_DIRECTION
Definition: inszt_adc.c:21888
void PLIB_USART_RunInSleepModeEnable(USART_MODULE_ID index)
void PLIB_DMA_ChannelXChainEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsSlaveSelectControl(SPI_MODULE_ID index)
SYS_STATUS DRV_SPI_Status(SYS_MODULE_OBJ object)
uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_ADDRESS_OFFSET_TYPE offset)
bool PLIB_USART_ExistsReceiverDataAvailableStatus(USART_MODULE_ID index)
void PLIB_PORTS_PinDirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
TMR_PRESCALE DRV_TMR2_PrescalerGet(void)
bool PLIB_USART_ReceiverAddressIsReceived(USART_MODULE_ID index)
void PLIB_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static int USB_62zqzqzq(int qqqi)
Definition: inszt_USB.c:29408
void DRV_TMR2_StopInIdleDisable(void)
bool PLIB_DMA_ExistsChannelXCellSize(DMA_MODULE_ID index)
uint8_t PLIB_DMA_CRCPolynomialLengthGet(DMA_MODULE_ID index)
void DRV_TMR1_StopInIdleDisable(void)
uint16_t PLIB_DMA_ChannelXPeripheralAddressGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsStopInIdleControl(SPI_MODULE_ID index)
void PLIB_USART_Enable(USART_MODULE_ID index)
void PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_ChannelXINTSourceFlagSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_USART_ExistsWakeOnStart(USART_MODULE_ID index)
void PLIB_DMA_ChannelXBusyActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_OperationModeSelect(USART_MODULE_ID index, USART_OPERATION_MODE operationmode)
bool PLIB_USART_ExistsReceiverOverrunStatus(USART_MODULE_ID index)
USB_STATES state
Definition: inszt_app.c:30499
uintptr_t DRV_HANDLE
Definition: inszt_USB.c:1023
void PLIB_SPI_AudioErrorDisable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
void qqqtotalreset(void)
Definition: inszt_main.c:7067
void PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_PORTS_CnPinsPullUpDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void(* DRV_USART_BUFFER_EVENT_HANDLER)(DRV_USART_BUFFER_EVENT event, DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t context)
Definition: inszt_USB.c:15111
static int QQQfirstmcdc
Definition: inszt_USB.c:76
bool PLIB_DMA_ChannelXNullWriteModeIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint8_t DRV_USART0_ReadByte(void)
bool PLIB_DMA_ChannelXCollisionStatus(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_COLLISION collisonType)
void SYS_DEBUG_Print(const char *format,...)
bool PLIB_PORTS_ExistsPortsOpenDrain(PORTS_MODULE_ID index)
struct _DRV_SPI_CLIENT_DATA DRV_SPI_CLIENT_DATA
COMM_STATES
Definition: inszt_USB.c:28055
DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_USART_ERROR
Definition: inszt_USB.c:15341
static void DRV_TMR1_Tasks(void)
Definition: inszt_USB.c:3810
uint32_t DRV_TMR_CounterFrequencyGet(DRV_HANDLE handle)
DRV_USART_HANDSHAKE
Definition: inszt_adc.c:15241
DRV_SPI_MODE
Definition: inszt_adc.c:26421
void PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove(DRV_USART_BUFFER_HANDLE bufferHandle)
void PLIB_USART_BRGClockSourceSelect(USART_MODULE_ID index, USART_BRG_CLOCK_SOURCE brgClockSource)
bool PLIB_PORTS_ExistsPortsRead(PORTS_MODULE_ID index)
DRV_SPI_BUFFER_TYPE bufferType
Definition: inszt_adc.c:26574
void PLIB_DMA_ChannelXTriggerEnable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
void PLIB_DMA_ChannelPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL_PRIORITY channelPriority)
bool PLIB_SPI_ExistsAudioTransmitMode(SPI_MODULE_ID index)
void DRV_ADC1_Close(void)
bool PLIB_DMA_LastBusAccessIsWrite(DMA_MODULE_ID index)
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART0_LineControlSet(DRV_USART_LINE_CONTROL lineControlMode)
void SYS_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
DRV_USART_BAUD_SET_RESULT
Definition: inszt_USB.c:15181
void PLIB_SPI_PinDisable(SPI_MODULE_ID index, SPI_PIN pin)
void PLIB_PORTS_CnPinsEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void APP_Tasks(void)
Definition: app.c:130
static void qqoutput3(FILEPOINT char *s, int i, int j, int k)
Definition: inszt_USB.c:29231
unsigned int DRV_USART0_TransmitBufferSizeGet(void)
bool PLIB_USART_ExistsReceiverAddressAutoDetect(USART_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXEvent(DMA_MODULE_ID index)
SYS_ERROR_LEVEL
Definition: inszt_USB.c:17463
void PLIB_USART_BaudRateAutoDetectEnable(USART_MODULE_ID index)
void PLIB_USART_BaudRateHighDisable(USART_MODULE_ID index)
bool PLIB_USART_TransmitterBreakSendIsComplete(USART_MODULE_ID index)
void SYS_DMA_ChannelAbortEventSet(SYS_DMA_CHANNEL_HANDLE handle, DMA_TRIGGER_SOURCE eventSrc)
bool PLIB_PORTS_PinGetLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXDataSizeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_DATA_SIZE channelDataSize)
DRV_IO_BUFFER_TYPES
Definition: inszt_USB.c:991
void PLIB_USART_RunInSleepModeDisable(USART_MODULE_ID index)
bool PLIB_SPI_TransmitBufferIsFull(SPI_MODULE_ID index)
DRV_USART_CLIENT_STATUS
Definition: inszt_adc.c:15464
SYS_MODULE_OBJ DRV_TMR_Initialize(const SYS_MODULE_INDEX drvIndex, const SYS_MODULE_INIT *const init)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
void PLIB_USART_BaudSetAndEnable(USART_MODULE_ID index, uint32_t systemClock, uint32_t baud)
uint32_t PLIB_USART_BaudRateGet(USART_MODULE_ID index, int32_t clockFrequency)
void(* ldra_void_function)()
Definition: inszt_USB.c:115
void PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
TMR_PRESCALE DRV_TMR0_PrescalerGet(void)
uint16_t PLIB_DMA_ChannelXSourceSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_DMA_ChannelXINTSourceFlagClear(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
USB_DEVICE_TRANSFER_HANDLE writeTranferHandle
Definition: inszt_app.c:30506
static void DRV_TMR0_Tasks(void)
Definition: inszt_USB.c:3700
size_t DRV_USART_BufferCompletedBytesGet(DRV_USART_BUFFER_HANDLE bufferHandle)
DRV_IO_INTENT
Definition: inszt_adc.c:975
bool PLIB_SPI_ExistsAudioProtocolControl(SPI_MODULE_ID index)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26603
void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePullUpPerPort(PORTS_MODULE_ID index)
USB_STATES
Definition: inszt_USB.c:27623
void PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_ErrorInterruptDisable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
void PLIB_DMA_ChannelXEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_MODULE_OBJ DRV_USART0_Initialize(void)
void PLIB_USART_ReceiverIdleStateLowDisable(USART_MODULE_ID index)
void PLIB_SPI_StopInIdleDisable(SPI_MODULE_ID index)
uint32_t DRV_TMR2_CounterValueGet(void)
uint16_t endpointSize
Definition: USB.c:71
USB_DEVICE_HANDLE usbDevHandle
Definition: inszt_app.c:30500
static void usb_watchdog(void)
Definition: inszt_USB.c:29035
void PLIB_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION inputFunction, PORTS_REMAP_INPUT_PIN remapInputPin)
void(* DRV_TMR_CALLBACK)(uintptr_t context, uint32_t alarmCount)
Definition: inszt_USB.c:1843
size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_SPI_FIFOInterruptModeSelect(SPI_MODULE_ID index, SPI_FIFO_INTERRUPT mode)
DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_FrameSyncPulsePolaritySelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_POLARITY polarity)
void SYS_PORTS_ChangeNotificationGlobalEnable(PORTS_MODULE_ID index)
bool PLIB_USART_ExistsReceiverIdleStatus(USART_MODULE_ID index)
void PLIB_SPI_BufferClear(SPI_MODULE_ID index)
SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void)
bool PLIB_USART_ExistsTransmitterInterruptMode(USART_MODULE_ID index)
void DRV_USART_BufferAddWrite(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *bufferHandle, void *buffer, const size_t size)
bool PLIB_SPI_ExistsFrameSyncPulseWidth(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsTransmitBufferEmptyStatus(SPI_MODULE_ID index)
void qqqtotalupload(void)
Definition: inszt_main.c:7054
void PLIB_DMA_CRCAppendModeEnable(DMA_MODULE_ID index)
void DRV_USART_ByteErrorCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
bool DRV_IC0_BufferIsEmpty(void)
SYS_DMA_CHANNEL_OP_MODE
Definition: inszt_adc.c:13381
uint32_t DRV_TMR3_CounterFrequencyGet(void)
bool PLIB_USART_WakeOnStartIsEnabled(USART_MODULE_ID index)
uint16_t PLIB_SPI_BufferRead16bit(SPI_MODULE_ID index)
bool DRV_USART0_ReceiverBufferIsEmpty(void)
SPI_FRAME_PULSE_EDGE framePulseEdge
Definition: inszt_adc.c:26555
bool PLIB_DMA_ExistsLastBusAccess(DMA_MODULE_ID index)
void DRV_TMR2_PeriodValueSet(uint32_t value)
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet(DMA_MODULE_ID index)
void DRV_USART_AddressedBufferAddWrite(const DRV_HANDLE hClient, DRV_USART_BUFFER_HANDLE *bufferHandle, uint8_t address, void *source, size_t nWords)
uint32_t DRV_TMR0_PeriodValueGet(void)
SPI_MODULE_ID spiId
Definition: inszt_adc.c:26537
void PLIB_SPI_AudioProtocolEnable(SPI_MODULE_ID index)
DRV_HANDLE DRV_USART0_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
void DRV_TMR4_PeriodValueSet(uint32_t value)
void PLIB_DMA_StartTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_STATUS DRV_USART_Status(SYS_MODULE_OBJ object)
static char qqqqone[]
Definition: inszt_USB.c:29138
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsReceiverFramingErrorStatus(USART_MODULE_ID index)
unsigned int DRV_USART0_ReceiverBufferSizeGet(void)
bool PLIB_DMA_ExistsChannelXPatternLength(DMA_MODULE_ID index)
static void DRV_TMR2_Close(void)
Definition: inszt_USB.c:3880
DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void DRV_TMR3_StopInIdleEnable(void)
SYS_DMA_DATA_WIDTH
Definition: inszt_USB.c:13437
void PLIB_USART_IrDAEnable(USART_MODULE_ID index)
void PLIB_USART_ReceiverDisable(USART_MODULE_ID index)
uint8_t PLIB_DMA_ChannelBitsGet(DMA_MODULE_ID index)
void DRV_SPI_Tasks(SYS_MODULE_OBJ object)
uint32_t PLIB_DMA_RecentAddressAccessed(DMA_MODULE_ID index)
bool PLIB_USART_ExistsIrDA(USART_MODULE_ID index)
bool PLIB_USART_ExistsTransmitterIdleIsLow(USART_MODULE_ID index)
uint32_t PORTS_DATA_TYPE
Definition: inszt_USB.c:18447
void PLIB_DMA_ChannelXCellSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t CellSize)
void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level)
bool PLIB_DMA_ExistsCRCBitOrder(DMA_MODULE_ID index)
TMR_PRESCALE DRV_TMR3_PrescalerGet(void)
bool PLIB_DMA_ExistsChannelXPatternData(DMA_MODULE_ID index)
static void qqqbitmapreset(qqnull_params)
void DRV_USART0_Deinitialize(void)
bool DRV_USART_TransmitBufferIsFull(const DRV_HANDLE handle)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
bool tick
Definition: inszt_app.c:30513
bool PLIB_PORTS_ExistsChangeNoticeInIdle(PORTS_MODULE_ID index)
bool PLIB_SPI_ExistsBusStatus(SPI_MODULE_ID index)
int QQQindicator
Definition: inszt_main.c:104
void PLIB_PORTS_ChannelSlewRateSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK channelMask, PORTS_PIN_SLEW_RATE slewRate)
PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void(* DRV_USART_BYTE_EVENT_HANDLER)(const SYS_MODULE_INDEX index)
Definition: inszt_USB.c:15143
void DRV_TMR2_CounterClear(void)
void SYS_DMA_ChannelTransferEventHandlerSet(SYS_DMA_CHANNEL_HANDLE handle, const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler, const uintptr_t contextHandle)
static void Fifo_Init(TFifo *ptrFifo, uint8_t *ptrBuffer, uint16_t Length)
SYS_ERROR_LEVEL
Definition: inszt_adc.c:17548
DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus(DRV_HANDLE handle)
uint32_t DRV_TMR4_PeriodValueGet(void)
uintptr_t DRV_USART_BUFFER_HANDLE
Definition: inszt_adc.c:15035
bool PLIB_SPI_TransmitBufferIsEmpty(SPI_MODULE_ID index)
void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
void PLIB_DMA_BusyActiveSet(DMA_MODULE_ID index)
void PLIB_USART_InitializeOperation(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE receiveInterruptMode, USART_TRANSMIT_INTR_MODE transmitInterruptMode, USART_OPERATION_MODE operationMode)
static SYS_STATUS DRV_TMR3_Status(void)
Definition: inszt_USB.c:3958
#define QQQnumfil
Definition: inszt_USB.c:51
bool PLIB_SPI_ReceiverFIFOIsEmpty(SPI_MODULE_ID index)
void SYS_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
bool PLIB_DMA_ExistsChannelXDestinationSize(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsErrorInterruptControl(SPI_MODULE_ID index)
static void ValidateComm(void)
void SYS_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
void DRV_PMP0_Write(uint8_t data)
DRV_SPI_MODE
Definition: inszt_USB.c:26336
void DRV_TMR4_CounterClear(void)
void PLIB_DMA_ChannelXOperatingTransferModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRANSFER_MODE channeltransferMode)
static void DRV_TMR2_Open(void)
Definition: inszt_USB.c:3859
void PLIB_USART_WakeOnStartDisable(USART_MODULE_ID index)
void PLIB_USART_Disable(USART_MODULE_ID index)
bool PLIB_DMA_ExistsCRC(DMA_MODULE_ID index)
static void qqoutput4(FILEPOINT char *s, int i, int j, int k, int l)
Definition: inszt_USB.c:29240
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26610
bool DRV_USART_ReceiverBufferIsEmpty(const DRV_HANDLE handle)
SYS_DMA_CHANNEL_CHAIN_PRIO
Definition: inszt_USB.c:13210
void PLIB_DMA_ChannelXPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_PRIORITY channelPriority)
uint16_t PLIB_DMA_ChannelXCellProgressPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void DRV_USART_TasksTransmit(SYS_MODULE_OBJ object)
void DRV_TMR0_PeriodValueSet(uint32_t value)
void SYS_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_Enable(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXSourceAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_SOURCE_ADDRESSING_MODE sourceAddressMode)
void PLIB_DMA_ChannelXDestinationStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t destinationStartAddress)
static void DRV_TMR4_Open(void)
Definition: inszt_USB.c:4079
void SYS_PORTS_PinPullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
CLK_BUSES_PERIPHERAL spiClk
Definition: inszt_adc.c:26570
void PLIB_SPI_BufferWrite16bit(SPI_MODULE_ID index, uint16_t data)
SYS_ERROR_LEVEL gblErrLvl
#define USB_62zqqzqz1
Definition: inszt_USB.c:79
USB_DEVICE_TRANSFER_HANDLE readTranferHandle
Definition: inszt_app.c:30507
void PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
DRV_TMR_CLIENT_STATUS DRV_TMR2_ClientStatus(void)
void SYS_DEBUG_Deinitialize(SYS_MODULE_OBJ object)
DRV_USART_CLIENT_STATUS DRV_USART0_ClientStatus(void)
static SYS_STATUS DRV_TMR1_Status(void)
Definition: inszt_USB.c:3738
void DRV_TMR_AlarmEnable(DRV_HANDLE handle, bool enable)
void SYS_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_SPI_FrameSyncPulseWidthSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_WIDTH width)
void SYS_PORTS_ChangeNotificationGlobalDisable(PORTS_MODULE_ID index)
void SYS_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
void SYS_PORTS_PinPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_PORTS_PinGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_SPI_ExistsEnableControl(SPI_MODULE_ID index)
SPI_COMMUNICATION_WIDTH commWidth
Definition: inszt_adc.c:26563
void PLIB_USART_ReceiverEnable(USART_MODULE_ID index)
bool PLIB_USART_ExistsRunInOverflow(USART_MODULE_ID index)
bool PLIB_SPI_ExistsCommunicationWidth(SPI_MODULE_ID index)
bool PLIB_USART_ReceiverOverrunHasOccurred(USART_MODULE_ID index)
DRV_TMR_OPERATION_MODE
Definition: inszt_USB.c:1763
void(* SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER)(SYS_DMA_TRANSFER_EVENT event, SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
Definition: inszt_USB.c:13544
void DRV_ADC1_Open(void)
void PLIB_DMA_ChannelXTriggerDisable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
void PLIB_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_ChannelXTriggerIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
static void qqoutput0(FILEPOINT char *s)
Definition: inszt_USB.c:29214
SYS_MODULE_OBJ SYS_DEBUG_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
bool PLIB_DMA_ExistsChannelXPriority(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsAudioCommunicationWidth(SPI_MODULE_ID index)
void DRV_USART_TasksError(SYS_MODULE_OBJ object)
uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
void PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
USB_DATA USB
Definition: inszt_USB.c:28398
bool SYS_PORTS_PinLatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePerPortStatus(PORTS_MODULE_ID index)
uint8_t PLIB_USART_AddressMaskGet(USART_MODULE_ID index)
void PLIB_DMA_CRCWriteByteOrderMaintain(DMA_MODULE_ID index)
uint32_t PORTS_DATA_TYPE
Definition: inszt_adc.c:18532
void PLIB_DMA_CRCWriteByteOrderAlter(DMA_MODULE_ID index)
DRV_USART_ERROR DRV_USART_ErrorGet(const DRV_HANDLE client)
bool PLIB_USART_ExistsOperationMode(USART_MODULE_ID index)
DRV_USART_OPERATION_MODE
Definition: inszt_adc.c:15059
void SYS_PORTS_ChangeNotificationPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
uint16_t DRV_IC0_Capture16BitDataRead(void)
bool epDataWritePending
Definition: inszt_app.c:30504
void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void DRV_TMR2_StopInIdleEnable(void)
DRV_USART_ERROR
Definition: inszt_adc.c:15426
bool PLIB_DMA_ChannelXAutoIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool DRV_TMR_AlarmDisable(DRV_HANDLE handle)
void DRV_PMP0_ModeConfig(void)
bool PLIB_USART_ReceiverParityErrorHasOccurred(USART_MODULE_ID index)
bool data_sent
Definition: USB.c:75
uint8_t queueSize
Definition: inszt_adc.c:26592
uint32_t DRV_TMR3_CounterValueGet(void)
static SYS_STATUS DRV_TMR0_Status(void)
Definition: inszt_USB.c:3628
bool DRV_TMR4_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
int qqqshell_upload
Definition: inszt_main.c:150
void SYS_PORTS_PinDirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod)
SYS_PORTS_PULLUP_PULLDOWN_STATUS
Definition: inszt_adc.c:21864
void SYS_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_USART_ModuleIsBusy(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePerPortInIdle(PORTS_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXDestinationStartAddress(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXDisabledDisablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_TMR_CLIENT_STATUS DRV_TMR3_ClientStatus(void)
SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate(DMA_CHANNEL channel)
bool attached
Definition: inszt_app.c:30512
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26642
bool PLIB_DMA_ExistsCRCAppendMode(DMA_MODULE_ID index)
bool PLIB_DMA_ChannelXINTSourceFlagGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void DRV_USART0_TasksReceive(void)
TFifo TX_FIFO
Definition: fifo.c:48
bool DRV_TMR_ClockSet(DRV_HANDLE handle, DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE preScale)
void DRV_USART_BufferEventHandlerSet(const DRV_HANDLE handle, const DRV_USART_BUFFER_EVENT_HANDLER eventHandler, const uintptr_t context)
bool SYS_DMA_IsBusy(void)
void PLIB_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
bool PLIB_USART_ExistsReceiverInterruptMode(USART_MODULE_ID index)
void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_USART_TransmitterBreakSend(USART_MODULE_ID index)
static void DRV_TMR3_Close(void)
Definition: inszt_USB.c:3990
void COMM_Tasks(void)
Definition: commmodule.c:88
bool PLIB_SPI_ExistsAudioErrorControl(SPI_MODULE_ID index)
void PLIB_PORTS_ChannelModeSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK modeMask, PORTS_PIN_MODE mode)
bool spiSlaveSSPin
Definition: inszt_adc.c:26547
void DRV_TMR0_CounterValueSet(uint32_t value)
bool PLIB_DMA_SuspendIsEnabled(DMA_MODULE_ID index)
int QQQfcn_ptr_num
Definition: inszt_main.c:151
bool PLIB_DMA_ChannelXIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsTransmitterEmptyStatus(USART_MODULE_ID index)
void DRV_TMR3_StopInIdleDisable(void)
USART_ERROR PLIB_USART_ErrorsGet(USART_MODULE_ID index)
void PLIB_SPI_FrameSyncPulseDirectionSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_DIRECTION direction)
DRV_USART_BUFFER_EVENT
Definition: inszt_adc.c:15096
bool deviceIsConfigured
Definition: inszt_app.c:30501
DRV_SPI_CLOCK_MODE
Definition: inszt_adc.c:26299
void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
void COMMAND_Tasks(void)
Definition: commands.c:225
bool PLIB_SPI_Exists16bitBuffer(SPI_MODULE_ID index)
void PLIB_SPI_OutputDataPhaseSelect(SPI_MODULE_ID index, SPI_OUTPUT_DATA_PHASE phase)
void PLIB_DMA_CRCDisable(DMA_MODULE_ID index)
DRV_TMR_CLK_SOURCES
Definition: inszt_USB.c:1609
struct _DRV_SPI_INIT DRV_SPI_INIT
bool PLIB_DMA_ExistsChannelXTrigger(DMA_MODULE_ID index)
void DRV_TMR1_StopInIdleEnable(void)
uint32_t DRV_TMR4_CounterValueGet(void)
COMM_DATA COMM
Definition: commmodule.c:58
bool PLIB_SPI_ExistsFrameErrorStatus(SPI_MODULE_ID index)
void PLIB_USART_RunInOverflowDisable(USART_MODULE_ID index)
bool DRV_TMR_AlarmRegister(DRV_HANDLE handle, uint32_t divider, bool isPeriodic, uintptr_t context, DRV_TMR_CALLBACK callBack)
bool PLIB_SPI_ExistsFIFOControl(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsPortsDirection(PORTS_MODULE_ID index)
static unsigned char qqqzzglobflag
Definition: inszt_USB.c:167
uint16_t PORTS_DATA_MASK
Definition: inszt_USB.c:18434
SYS_DMA_CHANNEL_OP_MODE
Definition: inszt_USB.c:13296
DRV_USART_INIT_FLAGS
Definition: inszt_adc.c:15364
DRV_TMR_CLIENT_STATUS
Definition: inszt_USB.c:1716
SYS_DMA_CRC_WRITE_ORDER
Definition: inszt_adc.c:13358
TMR_PRESCALE DRV_TMR_PrescalerGet(DRV_HANDLE handle)
bool GetDepthStatus(void)
bool PLIB_USART_ExistsBaudRateAutoDetect(USART_MODULE_ID index)
void PLIB_USART_TransmitterIdleIsLowDisable(USART_MODULE_ID index)
void DRV_ADC_Start(void)
void DRV_ADC0_Open(void)
void PLIB_USART_AddressMaskSet(USART_MODULE_ID index, uint8_t mask)
void PLIB_DMA_SuspendEnable(DMA_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
#define qqnull_params
Definition: inszt_USB.c:29133
void PLIB_DMA_ChannelXDestinationAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode)
void PLIB_DMA_ChannelXDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void DRV_TMR1_DeInitialize(void)
Definition: inszt_USB.c:3729
static SYS_STATUS DRV_TMR4_Status(void)
Definition: inszt_USB.c:4068
bool DRV_SPIn_ReceiverBufferIsFull(void)
void SYS_DMA_ChannelTransferSet(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
void SYS_DMA_ChannelSetup(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OP_MODE modeEnable, DMA_TRIGGER_SOURCE eventSrc)
void PLIB_SPI_AudioTransmitModeSelect(SPI_MODULE_ID index, SPI_AUDIO_TRANSMIT_MODE mode)
bool PLIB_PORTS_ExistsChangeNoticePullDownPerPort(PORTS_MODULE_ID index)
void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_DMA_ChannelXINTSourceEnable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
SPI_INPUT_SAMPLING_PHASE inputSamplePhase
Definition: inszt_adc.c:26578
DRV_USART_BAUD_SET_RESULT DRV_USART_BaudSet(const DRV_HANDLE client, uint32_t baud)
bool PLIB_USART_ExistsReceiverAddressDetect(USART_MODULE_ID index)
void PLIB_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
bool PLIB_SPI_ExistsMasterControl(SPI_MODULE_ID index)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26635
bool PLIB_USART_ExistsRunInSleepMode(USART_MODULE_ID index)
void DRV_USART_Deinitialize(SYS_MODULE_OBJ object)
DRV_TMR_CLIENT_STATUS DRV_TMR4_ClientStatus(void)
void PLIB_USART_AddressSet(USART_MODULE_ID index, uint8_t address)
uint32_t DRV_TMR4_CounterFrequencyGet(void)
void PLIB_USART_RunInOverflowEnable(USART_MODULE_ID index)
size_t DRV_USART_Read(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
bool PLIB_SPI_ExistsTransmitUnderRunStatus(SPI_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXPatternDataGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
uint16_t PLIB_DMA_ChannelXDestinationPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
DRV_TMR_OPERATION_MODE DRV_TMR0_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
bool PLIB_SPI_ReceiverHasOverflowed(SPI_MODULE_ID index)
void DRV_TMR2_Stop(void)
void PLIB_USART_ReceiverAddressAutoDetectDisable(USART_MODULE_ID index)
DRV_ADC_MODULE_ID
Definition: inszt_USB.c:1424
void PLIB_DMA_ChannelXTransferDirectionSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection)
void DRV_TMR_CounterClear(DRV_HANDLE handle)
bool DRV_TMR2_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
void PLIB_SPI_FrameSyncPulseCounterSelect(SPI_MODULE_ID index, SPI_FRAME_SYNC_PULSE pulse)
void PLIB_DMA_ChannelXINTSourceDisable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
ldra_void_function qqqaccumupload[QQQnumfil]
Definition: inszt_main.c:153
SPI_AUDIO_TRANSMIT_MODE audioTransmitMode
Definition: inszt_adc.c:26559
static void DRV_TMR3_Tasks(void)
Definition: inszt_USB.c:4030
uint8_t Fifo_Length(TFifo *ptrFifo)
Definition: fifo.c:202
bool PLIB_USART_ExistsReceiverParityErrorStatus(USART_MODULE_ID index)
uint8_t Fifo_Put(TFifo *ptrFifo, uint8_t Data)
Definition: fifo.c:117
uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
uint8_t altSetting
Definition: inszt_app.c:30510
TMR_PRESCALE DRV_TMR1_PrescalerGet(void)
SYS_STATUS SYS_DEBUG_Status(SYS_MODULE_OBJ object)
bool PLIB_USART_ExistsLineControlMode(USART_MODULE_ID index)
uintptr_t DRV_SPI_BUFFER_HANDLE
Definition: inszt_adc.c:26247
bool PLIB_USART_ExistsTransmitterBreak(USART_MODULE_ID index)
USB_ENDPOINT_ADDRESS endpointRx
Definition: inszt_app.c:30509
void PLIB_DMA_ChannelXDisabledEnablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
#define DRV_IC_Close(handle)
Definition: inszt_USB.c:1333
SYS_MODULE_OBJ DRV_USART_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
void PLIB_USART_ReceiverInterruptModeSelect(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE interruptMode)
bool PLIB_USART_ExistsLoopback(USART_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_TMR2_Initialize(void)
SPI_AUDIO_PROTOCOL audioProtocolMode
Definition: inszt_adc.c:26561
uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
uint8_t numTrfsSmPolled
Definition: inszt_adc.c:26587
DRV_SPI_CLOCK_MODE clockMode
Definition: inszt_adc.c:26576
SYS_STATUS DRV_TMR_Status(SYS_MODULE_OBJ object)
PORTS_PIN_INTERRUPT_TYPE
Definition: inszt_USB.c:21818
void PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
unsigned int DRV_USART_ReceiverBufferSizeGet(const DRV_HANDLE handle)
unsigned char uchar8_t
Definition: inszt_USB.c:27777
size_t DRV_USART_BufferProcessedSizeGet(DRV_USART_BUFFER_HANDLE bufferHandle)
bool DRV_TMR0_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
void PLIB_SPI_FIFODisable(SPI_MODULE_ID index)
void DRV_IC0_Initialize(void)
void PLIB_PORTS_PinChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
DRV_HANDLE DRV_TMR_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT intent)
bool PLIB_DMA_ExistsAbortTransfer(DMA_MODULE_ID index)
bool PLIB_USART_ExistsStopInIdle(USART_MODULE_ID index)
void DRV_TMR_Stop(DRV_HANDLE handle)
void DRV_TMR0_StopInIdleEnable(void)
bool PLIB_DMA_ExistsChannelXChainEnbl(DMA_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void * PLIB_USART_TransmitterAddressGet(USART_MODULE_ID index)
void DRV_TMR1_CounterValueSet(uint32_t value)
void PLIB_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uintptr_t SYS_DMA_CHANNEL_HANDLE
Definition: inszt_adc.c:13249
SYS_STATUS DRV_USART0_Status(void)
DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ChannelXReloadIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION function, PORTS_REMAP_OUTPUT_PIN remapPin)
bool DRV_TMR_GateModeClear(DRV_HANDLE handle)
TFifo RX_FIFO
Definition: fifo.c:47
void PLIB_USART_Transmitter9BitsSend(USART_MODULE_ID index, int8_t data, bool Bit9th)
bool DRV_TMR_GateModeSet(DRV_HANDLE handle)
DRV_USART_ERROR DRV_USART0_ErrorGet(void)
bool PLIB_USART_ExistsReceiverAddress(USART_MODULE_ID index)
static struct bitmapstruct_t bitmapstruct
void PLIB_DMA_CRCChannelSelect(DMA_MODULE_ID index, DMA_CHANNEL channel)
USB_STATES
Definition: inszt_app.c:30473
DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus(const DRV_HANDLE handle)
Definition: app.h:59
bool PLIB_PORTS_ExistsChangeNoticePullUp(PORTS_MODULE_ID index)
DRV_TMR_OPERATION_MODE DRV_TMR1_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void DRV_TMR0_Initialize(void)
void PLIB_PORTS_PinDirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_PORTS_ChangeNoticePerPortHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint32_t DRV_TMR2_PeriodValueGet(void)
void SYS_PORTS_ChangeNotificationInIdleModeDisable(PORTS_MODULE_ID index)
int32_t DRV_SPI_ClientConfigure(DRV_HANDLE handle, const DRV_SPI_CLIENT_DATA *cfgData)
void PLIB_DMA_ChannelXTransferCountSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t transferCount)
void PLIB_DMA_ChannelXAutoEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART_LineControlSet(const DRV_HANDLE client, const DRV_USART_LINE_CONTROL lineControl)
void DRV_USART0_WriteByte(const uint8_t byte)
void PLIB_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
DRV_USART_BUFFER_RESULT
Definition: inszt_adc.c:15118
void PLIB_PORTS_ChangeNoticeEnable(PORTS_MODULE_ID index)
void PLIB_DMA_CRCXOREnableSet(DMA_MODULE_ID index, uint32_t DMACRCXOREnableMask)
DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_IsBusy(DMA_MODULE_ID index)
static void qqqupload(qqnull_params)
Definition: inszt_USB.c:29385
void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index, SPI_AUDIO_PROTOCOL mode)
DRV_HANDLE DRV_USART_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
void PLIB_DMA_StopInIdleDisable(DMA_MODULE_ID index)
bool PLIB_DMA_ChannelXBusyIsBusy(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_SPI_CLOCK_MODE
Definition: inszt_USB.c:26214
INT_SOURCE rxInterruptSource
Definition: inszt_adc.c:26582
void SYS_PORTS_Initialize()
int qqupload_registered
Definition: inszt_main.c:6760
PORTS_PIN_INTERRUPT_TYPE
Definition: inszt_adc.c:21903
bool DRV_TMR3_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
static int zzfileid
Definition: inszt_USB.c:50
bool PLIB_DMA_ExistsCRCWriteByteOrder(DMA_MODULE_ID index)
static void qqqqinitialise(int ii)
Definition: inszt_USB.c:29255
void SYS_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION function, PORTS_REMAP_INPUT_PIN remapPin)
bool DRV_TMR_Start(DRV_HANDLE handle)
void DRV_IC0_Start(void)
void PLIB_PORTS_CnPinsDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void SYS_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_PORTS_ExistsChannelChangeNoticeMethod(PORTS_MODULE_ID index)
SYS_DMA_SIDL
Definition: inszt_USB.c:13190
void * PLIB_USART_ReceiverAddressGet(USART_MODULE_ID index)
uint32_t DRV_TMR_AlarmPeriodGet(DRV_HANDLE handle)
void DRV_TMR1_PeriodValueSet(uint32_t value)
void DRV_PMP0_TimingSet(PMP_DATA_WAIT_STATES dataWait, PMP_STROBE_WAIT_STATES strobeWait, PMP_DATA_HOLD_STATES dataHold)
DMA_CHANNEL PLIB_DMA_CRCChannelGet(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXNullWriteModeEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ExistsChannelXChain(DMA_MODULE_ID index)
static void DRV_TMR2_Tasks(void)
Definition: inszt_USB.c:3920
bool PLIB_SPI_ExistsInputSamplePhase(SPI_MODULE_ID index)
bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXAbortIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQ)
void PLIB_SPI_AudioProtocolDisable(SPI_MODULE_ID index)
PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_PORTS_PinModePerPortSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_MODE mode)
bool PLIB_USART_ExistsReceiverIdleStateLowEnable(USART_MODULE_ID index)
void PLIB_SPI_StopInIdleEnable(SPI_MODULE_ID index)
bool PLIB_SPI_Exists32bitBuffer(SPI_MODULE_ID index)
INT_SOURCE errInterruptSource
Definition: inszt_adc.c:26584
bool PLIB_USART_ExistsTransmitter(USART_MODULE_ID index)
DRV_TMR_CLK_SOURCES
Definition: inszt_adc.c:1694
bool PLIB_PORTS_ExistsChangeNoticeEdgeControl(PORTS_MODULE_ID index)
uint32_t DRV_TMR1_CounterValueGet(void)
uint32_t PLIB_DMA_CRCDataRead(DMA_MODULE_ID index)
void USB_Tasks(void)
Definition: inszt_USB.c:28611
bool PLIB_DMA_ExistsBusy(DMA_MODULE_ID index)
USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet(USART_MODULE_ID index)
ldra_void_function qqqaccumreset[QQQnumfil]
Definition: inszt_main.c:154
DRV_SPI_BUFFER_EVENT
Definition: inszt_USB.c:26314
void DRV_USART_WriteByte(const DRV_HANDLE handle, const uint8_t byte)
void DRV_TMR4_Initialize(void)
void PLIB_USART_BaudRateHighEnable(USART_MODULE_ID index)
void PLIB_DMA_ChannelXStartAddressOffsetSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t address, DMA_ADDRESS_OFFSET_TYPE offset)
uint32_t PLIB_SPI_BufferRead32bit(SPI_MODULE_ID index)
uintptr_t SYS_DMA_CHANNEL_HANDLE
Definition: inszt_USB.c:13164
bool PLIB_DMA_ExistsCRCXOREnable(DMA_MODULE_ID index)
void PLIB_SPI_AudioCommunicationWidthSelect(SPI_MODULE_ID index, SPI_AUDIO_COMMUNICATION_WIDTH mode)
bool PLIB_DMA_ExistsCRCByteOrder(DMA_MODULE_ID index)
COMMAND_DATA CMD
Definition: commands.c:196
void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_DMA_ExistsRecentAddress(DMA_MODULE_ID index)
void DRV_TMR_AlarmDeregister(DRV_HANDLE handle)
void PLIB_DMA_ChannelXReloadEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR4_Stop(void)
uint32_t DRV_TMR3_PeriodValueGet(void)
DRV_SPI_MODE spiMode
Definition: inszt_adc.c:26541
SYS_DMA_TRANSFER_EVENT
Definition: inszt_USB.c:13384
void PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_USART_ExistsReceiver9Bits(USART_MODULE_ID index)
static DRV_TMR_OPERATION_MODE DRV_TMR1_OperationModeGet(void)
Definition: inszt_USB.c:3760
bool PLIB_SPI_ExistsReadDataSignStatus(SPI_MODULE_ID index)
bool PLIB_DMA_ChannelXEventIsDetected(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ExistsChannelXAuto(DMA_MODULE_ID index)
bool PLIB_SPI_FIFOShiftRegisterIsEmpty(SPI_MODULE_ID index)
void PLIB_DMA_CRCBitOrderSelect(DMA_MODULE_ID index, DMA_CRC_BIT_ORDER bitOrder)
void DRV_IC0_Stop(void)
void PLIB_SPI_ErrorInterruptEnable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
uint8_t DRV_USART_ReadByte(const DRV_HANDLE handle)
void DRV_USART_BufferAddRead(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *const bufferHandle, void *buffer, const size_t size)
PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_SPI_AudioErrorEnable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
void PLIB_DMA_ChannelXDestinationSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t destinationSize)
DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint32_t DRV_TMR1_PeriodValueGet(void)
int8_t PLIB_USART_ReceiverByteReceive(USART_MODULE_ID index)
void DRV_USART_ByteReceiveCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
DRV_SPI_TASK_MODE taskMode
Definition: inszt_adc.c:26539
void PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
DRV_SPI_PROTOCOL_TYPE
Definition: inszt_USB.c:26282
void PLIB_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_USART_ReceiverDataIsAvailable(USART_MODULE_ID index)
bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
DRV_USART_LINE_CONTROL_SET_RESULT
Definition: inszt_USB.c:15202
DRV_USART_TRANSFER_STATUS DRV_USART0_TransferStatus(void)
DMA_CHANNEL_INT_SOURCE PLIB_DMA_ChannelXTriggerSourceNumberGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXSourceSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t sourceSize)
static void DRV_TMR4_DeInitialize(void)
Definition: inszt_USB.c:4059
DRV_TMR_OPERATION_MODE DRV_TMR2_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet(DRV_HANDLE handle, DRV_TMR_DIVIDER_RANGE *pDivRange)
void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus(DRV_SPI_BUFFER_HANDLE bufferHandle)
COMM_STATES state
Definition: commmodule.h:81
uint32_t DRV_TMR_AlarmHasElapsed(DRV_HANDLE handle)
SYSTEM_OBJECTS sysObj
uint8_t usb_tick_count
Definition: USB.c:73
void PLIB_USART_WakeOnStartEnable(USART_MODULE_ID index)
bool DRV_TMR4_Start(void)
uint32_t DRV_TMR_CounterValueGet(DRV_HANDLE handle)
bool PLIB_PORTS_ExistsRemapOutput(PORTS_MODULE_ID index)
void DRV_TMR2_CounterValueSet(uint32_t value)
void DRV_SPI_Deinitialize(SYS_MODULE_OBJ object)
void DRV_TMR3_Stop(void)
void SYS_PORTS_PinPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_TMR0_Stop(void)
void PLIB_USART_InitializeModeGeneral(USART_MODULE_ID index, bool autobaud, bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle)
static int qqqqbmselwidth
Definition: inszt_USB.c:49
bool PLIB_PORTS_ExistsRemapInput(PORTS_MODULE_ID index)
void PLIB_USART_BaudRateSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
bool PLIB_DMA_ExistsChannelXAbortIRQ(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXSourceSize(DMA_MODULE_ID index)
void PLIB_PORTS_PinChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_SPI_PinEnable(SPI_MODULE_ID index, SPI_PIN pin)
bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_CHANGE_NOTICE_EDGE cnEdgeType)
void PLIB_SPI_Disable(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsFramedCommunication(SPI_MODULE_ID index)
void SYS_PORTS_DirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void DRV_USART_Close(const DRV_HANDLE handle)
bool DRV_SPIn_TransmitterBufferIsFull(void)
void SYS_PORTS_ChangeNotificationDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void * PLIB_SPI_BufferAddressGet(SPI_MODULE_ID index)
void PLIB_USART_ReceiverAddressDetectEnable(USART_MODULE_ID index)
bool PLIB_SPI_ExistsReceiveFIFOStatus(SPI_MODULE_ID index)
static void DRV_TMR0_DeInitialize(void)
Definition: inszt_USB.c:3619
SPI_FRAME_SYNC_PULSE frameSyncPulse
Definition: inszt_adc.c:26549
void PLIB_SPI_BufferWrite(SPI_MODULE_ID index, uint8_t data)
bool PLIB_USART_ExistsBaudRateHigh(USART_MODULE_ID index)
void PLIB_USART_ReceiverIdleStateLowEnable(USART_MODULE_ID index)
bool PLIB_SPI_ExistsReceiverOverflow(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticeEdgeStatus(PORTS_MODULE_ID index)
bool PLIB_DMA_ExistsEnableControl(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsSuspend(DMA_MODULE_ID index)
uint32_t DRV_ADC_SamplesRead(uint8_t bufIndex)
bool DRV_USART0_TransmitBufferIsFull(void)
void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
void PLIB_SPI_BaudRateClockSelect(SPI_MODULE_ID index, SPI_BAUD_RATE_CLOCK type)
bool PLIB_USART_ExistsHandshakeMode(USART_MODULE_ID index)
SYS_DMA_TRANSFER_EVENT
Definition: inszt_adc.c:13469
static void Execute_Auto_Protocol_A(void)
uint16_t PLIB_DMA_ChannelXDestinationSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_PORTS_ExistsAnPinsMode(PORTS_MODULE_ID index)
bool SYS_PORTS_PinRead(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static int tbrun_mode
Definition: inszt_USB.c:97
uint32_t DRV_IC0_Capture32BitDataRead(void)
static void DRV_TMR1_Close(void)
Definition: inszt_USB.c:3770
bool PLIB_SPI_ExistsBaudRate(SPI_MODULE_ID index)
void PLIB_USART_TransmitterDisable(USART_MODULE_ID index)
void SYS_DMA_ChannelCRCSet(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc)
void PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
void PLIB_SPI_BufferWrite32bit(SPI_MODULE_ID index, uint32_t data)
void PLIB_DMA_CRCByteOrderSelect(DMA_MODULE_ID index, DMA_CRC_BYTE_ORDER byteOrder)